Bolivian President Evo Morales resigned Sunday under mounting pressure from the military and the public after his re-election victory triggered weeks of fraud allegations and deadly protests.

The decision came after a day of fast-moving developments, including an offer from Morales to hold a new election. But the crisis deepened dramatically when the country’s military chief went on national television to call on him to step down.

“I am sending my resignation letter to the Legislative Assembly of Bolivia,” the 60-year-old socialist leader said.

Anti-government protesters march with a flag from the department of Potosi, against the reelection of President Evo Morales in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters march with a flag from the department of Potosi, against the reelection of President Evo Morales in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)

He added: “I ask you to stop attacking the brothers and sisters, stop burning and attacking.”

Before Morales had even finished his statement, car horns began sounding in La Paz and other cities, and people took to the streets to celebrate, waving Bolivian flags and setting off fireworks.

Morales was the first member of Bolivia’s indigenous population to become president and was in power for 13 years and nine months, the longest term in the country’s history.

Anti-government protesters march against the reelection of President Evo Morales in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters march against the reelection of President Evo Morales in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)

But his claim to have won a fourth term last month set off unrest that left three people dead and over 100 injured in clashes between his supporters and opponents.

Earlier in the day Sunday, the Organization of American States said in a preliminary report that it had found a “heap of observed irregularities” in the Oct. 20 election and that a new vote should be held.

Morale agreed to that. But within hours, military chief Gen. Williams Kaliman made it clear that would not be sufficient.

Supporters of Bolivian President Evo Morales block a road that connects La Paz and El Alto, to show their support of his apparent reelection in El Alto, Bolivia, Sunday, Nov. 10, 2019. President Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Supporters of Bolivian President Evo Morales block a road that connects La Paz and El Alto, to show their support of his apparent reelection in El Alto, Bolivia, Sunday, Nov. 10, 2019. President Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)

“After analyzing the situation of internal conflict, we ask the president to resign, allowing peace to be restored and stability to be maintained for the good of our Bolivia,” Kaliman said.

The leadership crisis escalated in the hours leading up Morales’ resignation. Two government ministers in charge of mines and hydrocarbons, the Chamber of Deputies president and three other pro-government legislators announced their resignations. Some said opposition supporters had threatened their families.

In addition, the head of Bolivia’s Supreme Electoral Tribunal stepped down after the OAS findings were released. Also, the attorney general’s office said it would investigate the tribunal’s judges for alleged fraud.

Anti-government protesters block a street meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters block a street meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)

Morales was first elected in 2006 and went on to preside over a commodities-fed economic boom in South America’s poorest country. The former leader of a coca growers union, he paved roads, sent Bolivia’s first satellite into space and curbed inflation.

But many who were once excited by his fairy-tale rise have grown wary of his reluctance to leave power.

He ran for a fourth term after refusing to abide by the results of a referendum that upheld term limits for the president. He was able to run because Bolivia’s constitutional court disallowed such limits.

A dove walks past a barricade made by anti-government demonstrators, meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
A dove walks past a barricade made by anti-government demonstrators, meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)

After the Oct. 20 vote, Morales declared himself the outright winner even before official results indicated he obtained just enough support to avoid a runoff with opposition leader and former President Carlos Mesa. A 24-hour lapse in releasing results fueled suspicions of vote-rigging.

The OAS sent a team to look into the election. Its preliminary recommendations included holding a new contest with a new electoral body.

“Mindful of the heap of observed irregularities, it’s not possible to guarantee the integrity of the numbers and give certainty of the results,” the OAS said in a statement.

One person that is part of a group of followers of President Evo Morales kicks towards a couple in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
One person that is part of a group of followers of President Evo Morales kicks towards a couple in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)

During the unrest, protesters torched the headquarters of local electoral tribunal offices and set up roadblocks that paralyzed parts of Bolivia.

Pressure on Morales increased ominously on Saturday when police on guard outside Bolivia’s presidential palace abandoned their posts and police retreated to their barracks in at least three cities.

__

Bolivia's President Evo Morales looks on during a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales calls for new elections in Bolivia following the release of a preliminary report by the Organization of American States (OAS) that found irregularities in the October 20 vote. (AP Photo/Juan Karita)
Bolivia’s President Evo Morales looks on during a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales calls for new elections in Bolivia following the release of a preliminary report by the Organization of American States (OAS) that found irregularities in the October 20 vote. (AP Photo/Juan Karita)

Associated Press writer Luis Andres Henao in Buenos Aires, Argentina, contributed to this report.

Bolivia's President Evo Morales looks on during a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Bolivia’s President Evo Morales looks on during a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Bolivia's President Evo Morales looks down during a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Bolivia’s President Evo Morales looks down during a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Bolivia's President Evo Morales attends a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Bolivia’s President Evo Morales attends a press conference in La Paz, Bolivia, Sunday, Nov. 10, 2019. Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters block a street meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters block a street meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters sit outside the presidential palace as a banner in the wall reads in Spanish
Anti-government protesters sit outside the presidential palace as a banner in the wall reads in Spanish ” Annulment of elections, strike for democracy, hunger strike” in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters block a street meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)
Anti-government protesters block a street meters away from the presidential palace in La Paz, Bolivia, Sunday, Nov. 10, 2019. President Evo Morales is calling for new presidential elections and an overhaul of the electoral system Sunday after a preliminary report by the Organization of American States found irregularities in the Oct. 20 elections. (AP Photo/Juan Karita)