Bolivian voters appeared to have delivered a slim but stinging defeat to President Evo Morales after election officials announced he had lost a bid to run for a fourth straight term in office.

As early results came in Morales appeared defiant and unwilling to accept what increasingly looked like his biggest electoral setback in 10 years. But the country’s electoral authorities announced on Tuesday night that voters in a referendum had ultimately rejected by a slim margin a constitutional amendment to let him run for a further term in 2019.

After the announcement people poured into the streets to celebrate in the eastern city of Santa Cruz, where opposition to Morales is strong. Fireworks also sounded in La Paz, where there is weariness of corruption in the governing party.

The ballot measure in Sunday’s referendum had been voted down 51% to 49% with 99.5 percent of the ballots counted, officials said. The outcome also blocks the vice-president, Alvaro Garcia, from running again.

Speaking to journalists earlier on Monday, Morales had said he would accept the result either way and pinned his hopes on a late surge of support in rural areas. “They don’t like us much in the city,” he said.

The referendum had asked voters if the constitution should be changed to allow Morales – Bolivia’s first indigenous president – to run in the 2019 election and potentially remain in power until 2025.

Morales said earlier that whatever the result he would not abandon his “struggle” and blamed his disappointing showing on an opposition “dirty war” on social media.



He added: “We’re anti-neoliberal, anti-capitalist, anti-imperialist, we’ve been formed that way. This struggle will continue whether the yes or the no wins. It will never be abandoned.”

The Guardian witnessed a tense standoff at Bolivia’s electoral body as opposition supporters shouted “fraud” at vote counters who continued working while the overseeing panel went to lunch. Opposition leader and former president Jorge “Tuto” Quiroga called on Organisation of America States election monitors not to leave the country until the final count had been announced.

Morales – who won all three of his presidential campaigns at a canter – had previously appeared resistant to the economic concerns and corruption allegations that have hurt his regional allies.



But his personal popularity has been eroded by a scandal involving a former lover, Gabriela Zapata, with whom he has admitted fathering a child. Deepening the president’s woes, Zapata holds an important position in the Chinese engineering company CAMC, which has secured more than $500m in contracts with the Bolivian government.



“In recent years there’s been a lot of corruption but it never touched the president of the republic,” said economist Carlos Toranzo. “This scandal has deeply impacted President Morales.”

The president had hoped to campaign on his impressive record over the past 10 years, during which he has led the most stable government in Bolivia’s history to improve indigenous rights, boost economic growth at an average rate of 5.15% a year and reduce poverty and inequality.

But critics accuse him of an authoritarian streak and of favouring his own Aymara majority over other indigenous groups.

The election has done little to dispel such fears. Six people died when demonstrators from Morales’ MAS (Movement Towards Socialism) party set fire to an opposition-run town hall in El Alto. Despite being a traditional stronghold of support for Morales, enraged residents protested outside the burned-out building, vowing to “punish” Morales at the ballot box.

Many voters were uneasy about allowing the president to extend his period in office.



At a polling station in the middle-class Sopocachi neighbourhood in La Paz, Marleny Aramayo said: “I voted no because it’s never a good thing when the authorities remain in political office for an unlimited time, especially with a job as difficult as managing the state.”



“I have always voted for the process of change and I support the progress we’ve made in Bolivia but this time I voted no”, said a former Morales supporter, Tatiana Aranieba. “I think the time is right for a change.”



But the closely contested result also highlights the gratitude of many Bolivians for the changes that have been introduced since Morales took power in 2006.



Felipa Aruquipa, a retired domestic employee, told the Guardian she voted yes for continuity.



“For so many years as a country we never moved forward, now we are really advancing and that’s thanks to Evo,” she said.

