Leftist Bolivian President Evo Morales has lost a referendum that would have cleared the way for him to run for a fourth term in 2019, the country's electoral commission has confirmed.
Morales, first elected in 2006 and now in his third term, had tried to persuade Bolivians that the constitution should be changed to allow him another run at the presidency.
He had gone into the referendum with solid support among those who credit him with slashing poverty, but he was hurt by accusations of corruption and cronyism in his socialist government and concerns he was being anti-democratic.
With over 99 percent of votes counted, the "no" side had 51.3 percent to the "yes" side's 48.7 percent, Bolivia's electoral commission said late on Tuesday (local time), adding that the votes remaining to be counted were not sufficient to affect the overall result.
The first exit polls on Sunday had signalled such an outcome, but Morales and his socialist government had insisted the results could change when rural and overseas votes were taken into consideration.
The result prompted celebrations in Santa Cruz, where criticism of Morales, widely considered to be Bolivia's first indigenous president, has been fiercest and the "no" vote won by a wider margin.
La Paz, the capital, remained quiet on Wednesday morning.
Public Works Minister Milton Claros told TV channel PAT that "the people are the ones who decide".
"For us it is a triumph for democracy because we have shown it working transparently and democracy is what comes first," he said.
Carlos Mesa, a former Bolivian president, tweeted: "What the vote of Bolivians has said is that there are no indispensable people, just indispensable causes".
What lay ahead was uncertain and worrying, said political analyst Ivan Arias, with no clear anointed successor to Morales nor an opposition alternative.