LIMA, Peru (AP) — Peru’s political crisis appeared on the verge of resolution Monday as Congress cleared the way for an elder statesman and consensus candidate to become the country’s third president in a week.

People waved the nation's red-and-white flag and blared horns on the streets of Peru's capital as Francisco Sagasi of the centrist Purple Party was selected as the new president of Congress.

The 76-year-old engineer has not yet been sworn into office but as head of Congress becomes the nation's chief of state by default. Peru currently has no president or vice president, making him next in line.

It will now fall on Sagasi to heal a nation bruised by a week of upheaval.

“What’s at stake is making a first step toward rebuilding confidence between the people and the state,” said Samuel Rotta, president of the Peruvian chapter of Transparency International.

Applause erupted in the legislative palace as Sagasti clinched the required majority vote. A respected academic, he has also spent decades consulting government institutions and held a post at the World Bank. Shortly after the vote, he took an oath to become Congress' president.

“For our country, for our youth, and for a better future, I do swear,” he said.

The Latin American nation’s political turmoil took a chaotic turn Sunday when interim leader Manuel Merino quit and Congress couldn’t decide on his replacement. That left Peru rudderless and in crisis less than a week after legislators ignited a storm of protest by removing President Martín Vizcarra, an anti-corruption crusader highly popular among Peruvians.

Congress sparked the calamity a week ago when lawmakers overwhelmingly voted to oust Vizcarra. Using a 19th-century-era clause, legislators accused him of “permanent moral incapacity,” saying he took over $630,000 in bribes in exchange for two construction contracts while governor of a small province years ago.

Prosecutors are investigating the accusations, but Vizcarra has not been charged. He vehemently denies any wrongdoing.

The move outraged many in Peru, who denounced it as an illegal power grab by a Congress full of inexperienced politicians looking out for their own interests. Half of the lawmakers are under investigation for potential crimes, including money laundering and homicide. Vizcarra wanted to do away with their parliamentary immunity — a move popular with Peruvians but not with the legislature.

Merino, a little-known rice farmer, was sworn into office last Tuesday as hundreds of Peruvians protested nearby. He promised to keep in place a scheduled presidential election in April. But his Cabinet appointments irked many, and a heavy-handed response by police fueled anger.

Peru has much on. the line: The country is in the throes of one of the world’s most lethal coronavirus outbreaks and political analysts say the constitutional crisis has cast the country’s democracy into jeopardy.

“I think this is the most serious democratic and human rights crisis we have seen since Fujimori was in power,” said analyst Alonso Gurmendi Dunkelberg, referring to the turbulent rule of strongman Alberto Fujimori from 1990 to 2000.

A network of human rights groups reported that 112 people were injured in Saturday’s protests from projectiles, batons and inhaling tear gas. Two died — Jack Pintado, 22, who was shot 11 times, including in the head, and Jordan Sotelo, 24, who was hit four times in the chest near his heart.

“Two young people were absurdly, stupidly, unjustly sacrificed by the police,” Peruvian writer and Nobel laureate Mario Vargas Llosa said in a recorded video shared on Twitter. “This repression — which is against all of Peru — needs to stop.”

The protests rocking Peru were unlike any seen in recent years, fueled largely by young people typically apathetic to the country’s notoriously erratic politics. They come a year after a wave of anti-government demonstrations around Latin America demanding better conditions for the poor and working class.

“We want the voice of the people to be heard,” protester Fernando Ramirez said as he banged a spoon against a pot at a weekend protest.

Merino stepped down Sunday after most of his Cabinet resigned.

The protests sent a resounding message to political elites that Peruvians will serve as a check on Congress if they try to illegitimately grab power, said Steven Levitsky, a Harvard University political scientist who has extensively studied Peru.

“This is a very good day for Peruvian democracy,” Levitsky said.

But hours after jubilant Peruvians filled the streets, cheering Merino’s departure, the country’s crisis was far from a resolution.

Congress has relatively few options for a new president that will appease protesters. An overwhelming majority — 105 of the 130 lawmakers — voted in favor of removing Vizcarra. They were widely expected to choose the latest president from among those who voted against Vizcarra's ouster.

“You look for someone who is clean — not corrupt, not tainted, not behaving in some sort of ridiculous self-interested way. You don’t have a lot of options,” Levitsky said.

After Merino quit, congressional leaders initially nominated Rocio Silva, a lawyer and poet from the leftist Broad Front party who would have become the country’s first female president. But just 42 of the 119 legislators who cast votes supported her nomination.

The timing of the crisis could not be worse. Peru has the world’s highest per-capita COVID-19 mortality rate and has seen one of Latin America’s worst economic contractions. The International Monetary Fund projects a 14% decline in GDP this year.

In Lima’s historic district — the focal point of protests — demonstrators laid flowers and wrote messages lamenting the two young men killed. Many put the blame squarely on those who voted for Vizcarra’s removal.

“The 105 congressmen are the only ones guilty in their deaths,” protester Rosa Rodriguez shouted through her face mask.

___

Armario reported from Bogota, Colombia.

Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.