BRASILIA, Brazil (AP) — Brazil’s Senate voted Thursday to impeach President Dilma Rousseff after a months-long fight that laid raw the country’s fury over corruption and economic decay, hurling Latin America’s largest country into political turmoil just months before it hosts the Summer Olympics.

Rousseff’s enraged backers called the move a coup d’etat and threatened wide-scale protests and strikes. Her foes, meanwhile, insisted that she had broken the law, and that the country’s deep political, social and economic woes could only be tackled without her.

The 55-22 vote means that Rousseff’s ally-turned-enemy, Vice President Michel Temer, will take over as acting president later Thursday while she is suspended. The Senate has 180 days to conduct a trial and decide whether Rousseff should be permanently removed from office.

“Did anyone think that we would get to 2018 with a recovery under this government? Impossible,” said Jose Serra, the opposition Social Democratic Party’s failed presidential candidate in the 2010 race that brought Rousseff into power. “The impeachment is just the start of the reconstruction.”

Rousseff, 68, was impeached for her alleged mishandling of the federal budget. Critics said she used accounting tricks to hide ballooning deficits and bolster an embattled government. Brazil’s first female president, who was tortured under the country’s dictatorship, has frequently blasted the impeachment push as modern-day coup, arguing she had not been charged with a crime and previous presidents did similar things.

She has also suggested that sexism in the male-dominated Congress played a role in the impeachment.

Rousseff’s impeachment ends 13 years of rule by the Workers’ Party, which is credited with lifting millions out of abject poverty but vilified for being at the wheel when billions were siphoned from the state oil company Petrobras.

Analysts also say Rousseff got herself into trouble with a prickly manner and a perceived reticence to work with legislators that may have alienated possible allies.

Temer, a 75-year-old career politician, has promised to cut spending and privatize many sectors controlled by the state. For weeks, he has been quietly putting together a new Cabinet in expectation of taking over, angering Rousseff supporters. The lower house voted 367-137 last month in favor of impeachment.

The marathon debate in the Senate began Wednesday morning and took 20 hours as dozens of lawmakers rose to give their opinions.

Humberto Costa, the Workers’ Party leader in the Senate, brandished a photo of Rousseff from her days as a young Marxist guerrilla during the country’s 1964-1985 dictatorship at the military proceedings against her.

Costa called Thursday’s impeachment the second unjust trial Rousseff had endured, saying it was a bid by Brazil’s traditional ruling classes to reassert their power and roll back Workers’ Party policies in favor of the poor.

“The Brazilian elite, the ruling class, which keeps treating this county as if it was their hereditary dominion, does not appreciate democracy,” Costa said.

When the impeachment measure was introduced last year in Congress, it was generally viewed as a long shot. As late as February, consultancies like Eurasia were predicting it wouldn’t even make it out of committee in the lower Chamber of Deputies.

But the momentum built, as Brazilians seethed over numerous corruption scandals linked to Petrobras and daily announcements of job losses added to a growing desperation. The Brazilian economy is expected to contract nearly 4 percent after an equally dismal 2015 and inflation and unemployment are hovering around 10 percent, underscoring a sharp decline since the South American giant enjoyed stellar growth for more than a decade.

Polls have said a majority of Brazilians supported impeaching Rousseff, though they also suggest the public is wary about those in the line of succession to take her place.

“Dilma is a bad president and waiting until 2018 was a horrible option,” said cab driver Alessandro Novais in Rio de Janeiro, minutes after the vote. “I don’t think Temer will be much better, but at least we can try something different to overcome the crisis.”

Temer has been implicated in the Petrobras corruption scheme as has Calheiros, the Senate head who is now No. 2 in the line of succession. Former House Speaker Eduardo Cunha, who had been second in line, was suspended from office this month over allegations of obstruction of justice and corruption.

Rousseff has vehemently denied her administration’s financial sleight of hand moves constituted a crime and argued that such maneuvers were used by prior presidents without repercussions. She has stressed that — unlike many of those who have pushed for impeachment — she does not face any allegations of personal corruption.

The impeachment process, Rousseff and her supporters say, amounts to a coup aimed at undoing social programs that have lifted an estimated 35 million Brazilians out of grinding poverty over the past years.

“I think Brazil went backward in institutional maturity,” said Tiago Cordeiro, digital media consultant. “I am shocked to see how people find it OK to oust a president without reason.”

Temer, of the centrist Democratic Movement Party, insists he would expand the popular social programs, though he has also signaled that fiscal rigor is needed to dig Brazil out of its current financial hole.

Adding to Brazilians’ economic worries, the investigation into a multibillion-dollar kickback scheme at Petrobras has ensnared dozens of elite politicians and businessmen across the political spectrum. Although Rousseff herself hasn’t been implicated, top officials in her party were and that tarnished her reputation.

The president “is having to pay for everything,” Sen. Telmario Mota de Oliveira said.

___

Savarese reported from Rio de Janeiro.