Peru's interim president, Manuel Merino, has resigned after political parties demanded he step down or face impeachment following two deaths during protests over the sudden ouster of his predecessor.
Merino had been in office for less than a week, after Peru's congress voted last Monday to remove Martin Vizcarra as president over bribery allegations, which he denies.
MPs were set to meet later on Sunday to determine who should be the country's next president or at least how he or she might be chosen.
In a televised speech at midday, Merino, the former head of congress who had led the push to impeach Vizcarra, asked his cabinet to remain in place to assist the transition.
He said his resignation was "irrevocable" and called for "peace and unity".
Peruvians poured onto the streets on Sunday afternoon to celebrate Merino's resignation, waving flags, chanting and banging pots.
But the announcement nonetheless plunges Peru deeper into uncertainty and legal disarray as MPs wrestle with who will take his place.
Thousands had staged some of the country's largest protests in decades - mostly peaceful but increasingly marred by clashes - since congress voted to remove Vizcarra.
Just minutes before Merino announced he would step down, congress president Luis Valdez said all of the country's political parties had agreed he should resign.
If he declined, Valdez said, MPs would launch impeachment proceedings.
The latest shakeup comes as Peru, the world's No. 2 copper producer, battles the coronavirus pandemic and what is expected to be its worst economic contraction in a century.
A tense week collapsed into chaos late on Saturday, after mostly peaceful demonstrations grew more intense by nightfall.
Two young protesters were killed in clashes, the public ombudsman said.
Peru's state medical program, EsSalud, confirmed in a statement two young men had died from gunshot wounds.
Peru's National Human Rights co-ordinator said 102 people were injured, some after inhaling tear gas.
At least nine had suffered gunshot wounds, health officials said.
After the violence, all of Merino's cabinet ministers, who had been sworn in on Thursday, offered their resignations, leading to renewed calls for Merino's departure.
Vizcarra, whose ouster prompted the crisis, called Merino a "dictator" installed by congress and warned against allowing MPs to once again determine who would become Peru's next leader.