(CNN)Bolivian President Evo Morales resigned Sunday amid growing opposition after an international audit found the results of last month's election could not be validated due to "serious irregularities."
Morales said he was stepping down "for the good of the country," which has been roiled by protests in the days following the October 20 election. Three people have died in the protests and hundreds have been injured.
"I regret this deeply," Morales said, speaking on national television. He will send his resignation letter to Congress in the next few hours, he said.
Morales did not plan to leave the country, he said. "I don't need to escape. I want the people of Bolivia to know that I have not robbed anyone, nothing. If someone thinks we are stealing, then tell me. Present the proof."
Demonstrators and the Bolivian opposition had accused electoral authorities of manipulating the vote count in favor of Morales, the country's longtime socialist leader. Morales denied the allegations, but declared himself the winner.
Morales was one of the longest-serving heads of state in Latin America. He had served nearly 14 years and was Bolivia's first indigenous president.
Celebrations broke out across the country as news of his resignation spread.
It's unclear who will become president
Vice President Álvaro García Linera also announced his resignation minutes after Morales.
According to the Bolivian Constitution, the President of the Senate Adriana Salvatierra Arriaza, 30, would be next in the line of succession. But it's not clear if she will ascend to the presidency because of widespread opposition to Morales' party.
How we got here
A series of alleged irregularities -- including failures in the chain of custody for ballots, alteration and forgery of electoral material, redirection of data to unauthorized servers and data manipulation -- impacted the official vote count, the OAS said.
In the hours after polls closed, preliminary results showed Morales slightly ahead of his opponent, former President Carlos Mesa. The tight margin would have prompted a runoff vote in December.
But the opposition and international observers became suspicious after election officials stopped the count for about 24 hours without an explanation. When the count resumed, Morales' lead had jumped significantly.
"The manipulations to the computer system (used in the elections) are of such magnitude that they must be deeply investigated by the Bolivian State to get to the bottom (of this issue)," the OAS said, in part.
The organization recommended new elections be held under the umbrella of "new electoral authorities in order to offer a reliable process."
Calls for Morales' resignation grew over the weekend. On Saturday, various police units joined those calls, while the head of the Bolivian Armed Forces, Commander Williams Kaliman, said his units would not confront protesters.
By Sunday Kaliman had gone a step further and asked Morales to resign in order to restore stability and peace.
A number of other government party officials on Sunday announced they were stepping down, including mayors and Víctor Borda, President of the Chamber of Deputies.
The US State Department is monitoring the "quickly unfolding events" in Bolivia, a US State Department spokesperson said. Earlier, US Secretary of State Mike Pompeo commended the OAS audit and said the US supported the new election and the installation of a new electoral council.
"In order to 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," Pompeo said.