Bolivian President Evo Morales has lost a referendum to allow him to seek a fourth term in office, his first direct election defeat since taking the reign in 2006, according to official results.
With 99.41 percent of votes counted, the Supreme Electoral Tribunal reported on its website on Tuesday that 51.33 percent of voters cast "No" ballots in the referendum, against 48.67 percent voting "Yes".
If Morales' party had won the referendum it would have allowed the president to run for re-election in 2019.
The outcome of Sunday's poll also blocks Vice President Alvaro Garcia from running again.
Morales, Bolivia's first indigenous president, helped lift millions out of poverty by more equitably distributing natural gas revenues, spurring the creation of an indigenous middle class.
But his governing Movement Toward Socialism party has been hit by scandals. The vote closely followed a revelation that Morales may have been personally involved in influence-peddling.
Until Sunday's ballot, Morales had won nationwide elections, including a 2009 rewrite of the constitution, with an average 61.5 percent of the vote.
The referendum's margin of defeat coincided almost exactly with two unofficial "quick count" samples announced on Sunday by polling firms.
The results showed allegations of vote fraud by some members of the opposition to be unfounded, said Jose Luis Exeni, a member of the electoral tribunal.
The vote count had been unusually slow and Garcia said earlier on Tuesday that the outcome would be a "cliff-hanger".
He claimed a right-wing conspiracy was "trying to make disappear by sleight of hand the rural vote that favours Morales." Garcia provided no evidence to back the claim.
Organization of American States observers reported no evidence of fraud, and the delegation's leader, former Dominican Republic President Leonel Fernandez, left Bolivia on Tuesday.
Opposition figures celebrated their projected victory.
"We have recovered democracy and the right to choose," said Samuel Doria Medina, whom Morales twice defeated in presidential elections.
Morales had said he was prepared to give up on a fourth term if voters rejected the bid.
"With my record, I can leave happily and go home content. I would love to be a sports trainer," the Spanish newspaper El Pais quoted him as saying.