President Evo Morales, who came to power in Bolivia over a decade ago as part of a leftist wave sweeping Latin America, resigned on Sunday after unrelenting protests by an infuriated population that accused him of undermining democracy by clinging to office.
Mr. Morales was once widely popular, and stayed in the presidency longer than any other current head of state in Latin America. He was the first Indigenous president in a country that had been led by a tiny elite of European descent for centuries, and he shepherded Bolivia through an era of economic growth and shrinking inequality, winning support from Bolivians who saw him as their first true representative in the capital.
But his reluctance to give up power — first bending the country’s laws to stand for a fourth election, then insisting that he won despite widespread concerns about fraud — left him besieged by protests, abandoned by allies and unable to count on the police and the armed forces, which sided with the protesters and demanded he resign.
As the country slipped into deeper turmoil over the weekend, protesters voiced their fear of Bolivia’s trajectory under Mr. Morales.
“This is not Cuba, this is not Venezuela!” they chanted in La Paz, Bolivia’s main city, over the weekend. “This is Bolivia, and Bolivia will be respected.”
Mr. Morales’s departure is a milestone in the spasms of unrest that have roiled Latin America in recent months. Several leaders in the region have been bedeviled by street protests, acts of vandalism and deepening political polarization — dynamics exacerbated by underperforming economies and rising outrage over inequality.
The beginning of the end for Mr. Morales came on Friday night, when a smattering of small police units made dramatic pronouncements that they were breaking from the government and joining protesters angry over suspicions that the Oct. 20 election had been rigged.
Officers in La Paz were among the first to join the revolt. Initially, many took to the streets with bandannas or surgical masks covering their faces, apparently fearful of being identified. But as their ranks grew, many shed the masks and used bullhorns to address protesters.
“Our duty will always be the defense of the people,” a female officer said through tears in a televised address. “The police are with the people!”
When Bolivians went to the polls in October, many expressed hope that the president would suffer his first electoral loss since his landslide victory in 2005. Graffiti messages denouncing Mr. Morales as a “dictator” were ubiquitous in the capital.
The opposition felt victorious when initial results showed that Mr. Morales would need to face former President Carlos Mesa in a runoff, having failed to carve out the 10-percentage-point margin needed for an outright win.
That scenario was potentially ruinous for Mr. Morales because other opposition candidates had endorsed Mr. Mesa.
Without explaining why, election officials stopped releasing information on the vote count for 24 hours. The evening after the election, they announced a stunning update: Mr. Morales had won outright, with enough votes to avoid a second round.
Opposition leaders and international observers cried foul, saying that Mr. Morales’s turn of fortune defied credulity. Angry mobs attacked election buildings around the country, setting some on fire.
In subsequent days, large demonstrations and strikes paralyzed much of the country. Mr. Morales defended his electoral triumph as rightful and called on supporters to take to the streets in a show of force. Many have, including bands that have roughed up people protesting the government.
But on Sunday, the Organization of American States, which monitored the Oct. 20 election, issued a preliminary report that outlined irregularities and said the vote should be annulled.
That same day, Mr. Morales called for a new election, in an extraordinary concession in the face of public fury and mounting evidence of electoral fraud — but it appeared to accomplish little.
Unappeased, demonstrators and opposition leaders renewed demands that Mr. Morales step down. “Mr. Evo has ruptured the constitutional order — he needs to leave,” said Luis Fernando Camacho, one of the main protest leaders.
The president’s hold on power appeared more and more tenuous as the day drew on.
Several leading figures in his party resigned, and the military launched operations that appeared intended to protect protesters from violent bands of Morales supporters who have killed several protesters and wounded scores.
Mr. Mesa, the former president who came in second in the disputed election, has said that the country’s political parties should come together and organize a new vote. He lashed out at the president and the vice president on Sunday for “this fraud, and the social unrest that has led to several deaths and hundreds of people wounded.”
Michael Kozak, the top diplomat at the State Department overseeing Latin America policy, endorsed the call for a new election. “All those implicated in the flawed process should step down,” he wrote on Twitter.
The groundswell of anger had been brewing well before the first vote was cast. Many Bolivians saw Mr. Morales’s fourth presidential bid as an affront to the country’s democratic norms.
In 2016, Mr. Morales had asked voters to do away with the two-term limit established in the 2009 Constitution, which was drafted and approved during the president’s first term. Voters narrowly rejected the proposal in a referendum — which, under Bolivian law, was supposed to have been binding.
But Mr. Morales found a workaround. The Constitutional Court, which is packed with his loyalists, held that term limits constricted human rights, giving Mr. Morales the right to run for office indefinitely.
As he was campaigning this year, Mr. Morales told the Brazilian journalist Silvia Colombo that he believed his country needed him at the helm — perhaps as much as he needed to remain in power.
“I don’t know what I would do if I were not president,” said Mr. Morales, who keeps a punishing work schedule that starts before dawn and on most days includes flights to remote corners of his homeland. “Bolivia is my life and my family.”
Mr. Morales, a member of the Aymara Indigenous people, rose to prominence as a union leader for coca leaf growers. His trajectory to the capital was a transformational moment for a country where Indigenous people had endured years of abuse and withering discrimination.
On his watch, the country’s power structure was upended. Women today hold nearly half the seats in Congress, and Indigenous people hold more sway than ever.
His first term also coincided with a commodities boom that allowed him and other leftist leaders in Latin America to lift millions out of poverty through subsidies and political patronage. One of the poorest nations in the world, Bolivia used proceeds from natural gas exports to turbocharge its economy.
His party, the Movement for Socialism, has long been the country’s dominant political force, controlling both houses of Congress. Opponents struggled to compete with Mr. Morales because of his enormous support, but they also faced enormous personal risk. Mr. Morales has unleashed allies in the judiciary against political rivals, many of whom have landed in jail or gone into exile.
Raúl L. Madrid, a professor of government and Latin American politics at the University of Texas at Austin who studies Bolivia closely, said Mr. Morales came to feel indispensable.
“I think he views himself as the savior of Bolivia, as a representative of the marginalized people of Bolivia, especially Indigenous people,” he said.
Mr. Madrid said that if Mr. Morales had stepped down after his second or third term, he would have walked away with a commendable legacy. Yet, he added, the president’s decision to try to remain in power was unsurprising.
“From the beginning, he was not interested in grooming a successor that could have threatened him from within,” Mr. Madrid said. “These populist leaders who try to hold on to power at all cost end up undermining their legacy, and people remember them as dictators or would-be dictators.”