In an unexpected U-turn, the woman who was named "acting president" by Peru's Congress has resigned just hours after being sworn in.
Mercedes Aráoz's swearing-in was an act of defiance by lawmakers angry at the dissolution of Congress by President Martín Vizcarra on Monday.
The move meant that Peru briefly had two politicians claiming to be the country's rightful leader.
Despite the constitutional crisis, Peru remained largely calm.
Ms Aráoz had been Mr Vizcarra's vice-president until he decided to dissolve Congress on Monday.
She was picked to lead Peru by opposition lawmakers who argued that by dissolving Congress, Mr Vizcarra had breached the constitution and that his position was therefore vacant.
They also suspended Mr Vizcarra from office for a year, but the government argued that because that vote had been carried out after the president had dissolved Congress, it was null and void.
What did Ms Aráoz say?
In a letter (in Spanish) published on Twitter, Ms Aráoz explained that she was resigning as acting president after the regional body, Organization of American States (OAS), had declared that it should be up to Peru's constitutional court to decide whether the dissolution of Congress was constitutional.
She said that she was also stepping down from her post as vice-president because she considered that the constitutional order had broken down in Peru.
She tweeted that she hoped that her resignation would lead to a general election being called as soon as possible.
Who is in charge now?
Following Ms Aráoz's resignation, Mr Vizcarra appears to be firmly back in charge.
Shortly after dissolving Congress, he had already received the support of the heads of the armed forces and the police and about 2,000 Peruvians had taken to the streets of the capital, Lima, and other cities to show their backing for Mr Vizcarra.
A dozen regional governors also said they supported Mr Vizcarra.
Why did President Vizcarra dissolve Congress?
The move came after months of deadlock in which the opposition-controlled Congress blocked the president's popular anti-corruption measures.
Mr Vizcarra took over as president in March 2018 after the then-leader, Pedro Pablo Kuczynski, resigned amid allegations of vote buying.
With four previous presidents under investigation for alleged corruption, Mr Vizcarra said he would make cleaning up Peruvian politics his main priority.
Peru's scandal-tainted presidents
- Pedro Pablo Kuczynski: Under house arrest while under investigation for alleged corruption linked to Brazilian construction giant Odebrecht
- Ollanta Humala: Accused of accepting $3m in illegal financing from Odebrecht for his electoral campaign
- Alan García: Killed himself in April as police arrived to detain him over bribery allegations also linked to Odebrecht
- Alejandro Toledo: In jail in the US, Peru has requested his extradition for allegedly taking $20m in bribes from Odebrecht
Read more about Odebrecht: Brazil's corruption scandal explained
But Congress, dominated by the opposition Popular Force party whose leader Keiko Fujimori is in detention while awaiting trial on corruption charges herself, has thwarted President Vizcarra's efforts at every step.
Frustrated, Mr Vizcarra invoked an article in the constitution which allows the president to dissolve Congress if it has twice voted "no" in a so-called "vote of confidence".
The stand-off between the legislature and Mr Vizcarra is likely to continue over the coming days, with Congress planning to meet again on Friday to vote on a motion to dismiss the president altogether.
Mr Vizcarra has meanwhile issued a decree setting a date for fresh parliamentary elections on 26 January. Those elected would then serve out the five-year period of the dissolved Congress, which comes to an end in 2021.
In the interim, a congressional commission made up of 27 lawmakers will take over legislative duties.
Was it constitutional to dissolve congress?
While there is an article in Peru's constitution allowing the president to dissolve Congress, Peruvians are divided on whether the standards were met in this case.
The speaker of Congress, Pedro Olaechea, said some lawmakers were considering bringing the case to Peru's constitutional court, so that it rules on whether the move was constitutional.