LA PAZ, Bolivia — Bolivian President Evo Morales said Sunday that he would resign after the military called on him to step down and allies tumbled away amid a fierce backlash over a disputed election that has roiled the South American nation.

Morales, the country's leader for nearly 14 years, said in televised comments that he would submit his resignation letter to help restore stability, although he aimed barbs at what he called a "civic coup."

The head of Bolivia's armed forces, Gen. Williams Kaliman, said Sunday that the military had asked Morales to step down after weeks of protests over the Oct. 20 presidential election, which Morales won.

"We suggest the President of the State renounce his presidential mandate, allowing peace to be restored and the stability maintained for the good of our Bolivia," Kaliman said.

"Likewise, we ask the Bolivian people and mobilized sectors to shed attitudes of violence and disorder among brothers so as not to stain our families with blood, pain and mourning."

Earlier Sunday, Morales had agreed to hold new elections after a report from the Organization of American States, or OAS, revealed serious irregularities in the Oct. 20 vote.

The OAS report said the election should be annulled after it had found "clear manipulations" of the voting system that called into question Morales' win, with a lead of just over 10 points over his main rival, Carlos Mesa.

Bolivian President Evo Morales speaks at a news conference at the presidential palace in La Paz, on Oct. 24. David Mercado / Reuters file

'Today we won a battle'

The election turmoil threatened to topple Morales, a survivor of Latin America's leftist "pink tide" two decades ago, and could ripple around the region at a time when left-leaning leaders have returned to power in Mexico and Argentina.

"This is important not only for the well-being of the Bolivian people, but also for the stability of Argentina, Chile, Peru, Paraguay and Brazil," said Juan Cruz Diaz, managing director of risk advisers Cefeidas Group.

Morales' legacy "will be compromised and the region will suffer another impact with consequences well beyond Bolivia," he said.

Morales, speaking at an news conference earlier, tried to placate critics by saying he would replace the country's electoral body for the new vote, although his opponents — already angry that he ran in defiance of term limits — were not assuaged.

Luis Fernando Camacho, a civic leader from the eastern city of Santa Cruz who has become a symbol of the opposition, said the OAS report clearly demonstrated election fraud. He reiterated his call for Morales to resign.

"Today we won a battle," Camacho told a crowd of cheering supporters in the capital, although he added more time was needed to repair the constitutional order and democracy. "Only when we can be sure that democracy is solid, then will we go back home."

U.S. Secretary of State Mike Pompeo had welcomed the call for a new vote to "ensure free and fair elections."

"In order to restore credibility to the electoral process, all government officials and officials of any political organizations implicated in the flawed October 20 elections should step aside from the electoral process," he said in a statement.

Morales allies fall

As the fallout from the audit swept across Bolivia, there were signs that Morales' support was waning fast.

Several of his allies resigned, including Mining Minister Cesar Navarro and Victor Borda, president of the Chamber of Deputies, who belongs to Morales' party. They both cited fear for the safety of their families.

Juan Carlos Huarachi, leader of the Bolivian Workers' Center, a powerful pro-government union, said Morales should stand down if doing so would help end the violence.

Demonstrators protest Bolivian President Evo Morales in La Paz on Friday. David Mercado / Reuters

In recent days, police forces were also seen joining anti-government protests, while the military said it would not "confront the people" over the issue after a weekslong standoff.

The attorney general's office also announced that it had ordered an investigation with the aim of prosecuting the members of the electoral body and others responsible for the irregularities.

When questioned about whether he would be a candidate in the new election, Morales told a local radio station that while he had a constitutional duty to finish his term, "candidacies must be secondary; what comes first is to pacify Bolivia."

Mesa said Morales and Vice President Alvaro Garcia Linera should not preside over the electoral process or be candidates.

"If you have an iota of patriotism, you should step aside," Mesa said at a news conference.

Download the NBC News app for breaking news

Morales, who came to power in 2006 as Bolivia's first indigenous leader, had defended his election win but said he would adhere to the findings of the OAS audit.

"The manipulations to the computer systems are of such magnitude that they must be deeply investigated by the Bolivian State to get to the bottom of and assign responsibility in this serious case," the preliminary OAS report said.

Voting should take place as soon as conditions are in place to guarantee its being able to go ahead, including a newly composed electoral body, the OAS said.

The OAS added that it was statistically unlikely that Morales had secured the 10 percentage-point margin of victory needed to win outright.

Local media reported that shots were fired at vehicles carrying a group of miners on their way to La Paz from the southern mining region of Potosi earlier Sunday, injuring several people. The official government human rights body issued a statement condemning the attack.