Suspended Brazilian president Dilma Rousseff answers questions during her impeachment trial at the National Congress in Brasilia on Aug. 29. (Evaristo Sa/AFP/Getty Images)

President Dilma Rousseff was stripped of her office Wednesday in the culmination of a political crisis that has left Latin America’s largest nation adrift, with an economy in deep recession and a public sharply divided over the country’s future.

Rousseff was impeached on arcane charges having to do with violating budget laws. But she was swept up in a tide of revulsion against Brazil’s political class as the once-flourishing economy contracted and political parties were tarred by a massive corruption scandal.

Wednesday’s 61-to-20 Senate vote closed out an extraordinary 13-year rule by the leftist Workers’ Party, which boasted of lifting tens of millions of Brazilians out of poverty before the economy began to nosedive and its political fortunes soured.

Rousseff was replaced by her former vice president and coalition partner, Michel Temer, who has been running Brazil as interim president since she was suspended to face the impeachment trial in May. He belongs to the more conservative Brazilian Democratic Movement Party, or PMDB, and is trying to introduce austerity measures to right the economy.

Brazil's embattled president, Dilma Rousseff, is no longer the country's top politician. The judgment ends a a protracted process which began last December when the impeachment request got the green light in Brazil's lower house. (Marina Lopes, Dom Phillips, Jason Aldag / The Washington Post)

But Temer is as unpopular as Rousseff, and whether he can muster the political support for such changes was unclear.

Still, some Brazilians felt a sense of relief that the country had at last reached a decision on an impeachment process it began eight months ago.

“The impeachment does not in any way resolve the political or economic crisis, but it gives us some hope, because for the first time in a long time, we will have a plan,” said Lucas de Aragão, director of Arko Advice, a political analysis firm in Brasilia.

Rousseff’s removal marked the latest setback for Latin America’s left, which had been on the ascendancy just a few years ago in Argentina, Venezuela and other countries but has increasingly struggled amid a continent-wide economic slowdown and a series of corruption scandals.

The leftist governments of Ecuador, Venezuela and Bolivia recalled their ambassadors from Brazil on Wednesday after the vote, denouncing “a coup” by its Senate.

Indeed, many Brazilians believe Rousseff was removed not so much for her misdeeds as for her plunging popularity ratings. The impeachment trial may leave a legacy of distrust in Brazil’s political system, particularly among Workers’ Party supporters. There were demonstrations in cities across Brazil protesting the impeachment on Wednesday.

The trial ended with a series of emotional speeches in which the sympathizers of Brazil’s first female president made clear they felt the process was unjust.

“Scoundrels!” Sen. Lindbergh Farias, a member of her Workers’ Party, roared at one point.

“Coup mongers! History won’t forgive you!” Rousseff’s supporters chanted at another point. She was not present in the Senate for the vote.

Brazil’s highly respected former chief justice, Joaquim Barbosa, attacked the impeachment process.

“It is highly embarrassing. All of a sudden highly conservative forces took over all of Brazil,” he tweeted.

For her part, Rousseff responded by calling the Senate ruling the second coup she had faced in her life — after a military takeover decades ago. “The second [coup], delivered by way of a judicial farce, took me down from a role the people elected me to,” she said in a speech delivered to supporters and former colleagues.

Rousseff came to power in January 2011 at a time when the country was booming and the Workers’ Party — led by her predecessor and political mentor, Luiz Inácio Lula da Silva, known as Lula — was widely popular. She was reelected in 2014. But slumping oil prices­ and what many called inept political management dragged down the economy, which shrunk nearly 4 percent last year while inflation and unemployment surged. The country lost its precious investment grade rating.

Meanwhile, millions of Brazilians took to the streets to protest an enormous corruption scandal at state-run oil company Petrobras that has ensnared politicians from Rousseff’s party and its allies.

Since Temer became interim leader in May, there have been signs of a recovery of economic confidence, such as a reduction in credit default swap numbers. That indicates a drop in the level of risk that investors see in Brazil, said Armando Castelar, a professor of economics at the Federal University of Rio de Janeiro.

Temer is regarded as a wily political operator and has extensive congressional experience.

“I think he can put Brazil back on some kind of track,” said Heron do Carmo, a professor of economics at the University of Sao Paulo.

But there are already cracks showing in his coalition, with some party chiefs threatening to leave the alliance.

On Wednesday, the center-right Brazilian Social Democratic Party warned the new president that he needed to prove he was serious about tough fiscal reforms.

Temer’s party “needs to clearly state the level of its compromise with this government and the agenda of reforms that need to be put before the National Congress immediately,” said Aecio Neves, the party’s president.

Meanwhile, Temer’s popularity has plunged since he became interim president and immediately appointed an all-male cabinet. Within weeks, two of his ministers quit after being secretly recorded apparently plotting to obstruct the popular Petrobras investigation.

Many believe Temer could also still be embroiled in the Petrobras case, which has led to investigations of politicians from his party as well as Rousseff’s for alleged receipt of bribes and kickbacks.

A former Petrobras executive cooperating with the investigation has said that Temer asked for an illicit $400,000 campaign donation in 2012 for his party’s candidate for mayor of Sao Paulo. Temer denied the allegation.

“The problem is if there is a bruising denunciation against Michel Temer,” said Jairo Nicolau, a professor of political science at the Federal University of Rio de Janeiro.

Brazil has now impeached two of the four presidents it has elected since returning to democracy in 1985 after two decades of military dictatorship.

“We had four presidents elected, and two were removed. What democracy is this?” Sen. Jorge Viana of the Workers’ Party asked in a speech during the voting session.

Rousseff was charged with financial irregularities — using government banks to temporarily fund social programs and issuing spending decrees without congressional approval. Her opponents maintained that her actions contributed to the recession, the worst in decades in Brazil.

Rousseff maintained her innocence, saying she engaged in practices typical for Brazilian politicians. She has accused Temer of being one of the protagonists of the effort to oust her.

During questioning by senators on Monday, she denounced the trial as a “coup” and referred to the torture she suffered as a young Marxist guerrilla imprisoned by Brazil’s military dictatorship in the 1970s.

“I was scared of death, of the marks of torture on my body and my soul,” she said. “Today I only fear the death of democracy.”

Temer shot back at Rousseff at a meeting with ministers Wednesday that was open to journalists, according to O Globo newspaper.

“A coup monger is someone who violates the constitution,” he declared.

Phillips reported from Rio de Janeiro.