Senators voted 61-20 to convict the country’s first female president for illegally using money from state banks to bankroll public spending, marking the end of 13 years of leftist Workers Party rule.

Rousseff’s opponents hailed her removal as paving the way for a change of fortunes for Brazil. Her conservative successor, Michel Temer, the former vice president who has run Brazil since her suspension in May, inherits a bitterly divided nation with voters in no mood for the austerity measures needed to heal public finances.

In his first televised address to the nation after being sworn in as president through 2018, Temer called on Brazilians to unite behind him in working to rescue the economy from a fiscal crisis and over 11% unemployment.

“This moment is one of hope and recovery of confidence in Brazil. Uncertainty has ended,” Temer said in the speech broadcast after his departure for a G20 summit in China.

Until just a few years ago, Brazil was booming economically and its status was rising on the global stage.

The country then slid into its deepest recession in decades, and a graft scandal at state oil company Petrobras tarnished Rousseff’s coalition. Millions took to the streets this year to demand her removal, less than two years after she was re-elected.

A string of corruption scandals, led by the Petrobras scheme, has engulfed vast swaths of Brazil’s political class and business elites over the past 2-1/2 years.

Temer will likely face tough opposition from the Workers Party both on the streets and in Congress to his agenda of privatizations, reforms to Brazil’s generous pension and welfare laws and a public spending ceiling he hopes lawmakers will pass this year.

For the third straight day, pro-Rousseff demonstrators in Sao Paulo, Brazil’s largest city, clashed with riot police, who used tear gas to clear the streets.

Defiant to the end, Rousseff, a former leftist guerrilla who was tortured and jailed under military dictatorship in 1970, vowed to fight on in defense of Brazil’s workers.

Standing outside the presidential residence flanked by supporters, she insisted on her innocence and said her removal was a “parliamentary coup” backed by the economic elite that would roll back social programs that lifted millions of Brazilians out of poverty over the last decade.

“They think they have beaten us but they are mistaken,” Rousseff said, adding that she would appeal the decision using every legal means. “At this time, I will not say goodbye to you. I am certain I can say ‘See you soon.'”

The end of the Workers Party’s long grip on power sparked angry reactions from leftist governments across the region.

Venezuela, Bolivia and Ecuador withdrew their ambassadors, and Brazil responded by recalling its envoys for consultations. Cuba’s Communist government branded Rousseff’s ouster part of an “imperialist” offensive against progressive governments in Latin America.

The U.S. State Department voiced confidence that strong bilateral relations with Brazil would continue, adding the country’s democratic institutions had acted within the constitutional framework.

In an unexpected move, Brazil’s Senate voted 42-36 to allow Rousseff to retain the right to hold public office – a break with Brazilian law that specifies a dismissed president should be barred from holding any government job for eight years.

The move appeared to demonstrate unease among some senators, notably within Temer’s own fractious Brazilian Democratic Movement Party (PMDB), over whether a budgetary sleight of hand that is common in Brazil was truly an impeachable offense.

Visibly annoyed in televised remarks at his first cabinet meeting, Temer said he would not tolerate divisions in his coalition as he quickly tried to quash the first sign of splits that could grow as allies press him to deliver on austerity.

Aecio Neves, leader of the center-right PSDB party that backs Temer, said the divisions had caused acute concern among his allies, but he denied there was any prospect of a split.

“Brazil has given itself a new chance, to look to the future and construct an agenda for reform in line with the economic crisis,” said Neves, who narrowly lost the 2014 election to Rousseff.

HONKING HORNS, FIREWORKS

Motorists honked car horns in the Brazilian capital to mark the removal of a president whose popularity had dwindled to single figures since winning re-election in 2014. In Brazil’s largest city, Sao Paulo, fireworks exploded in celebration after the vote.

Temer has vowed to boost an economy that has shrunk for six consecutive quarters and implement austerity measures to plug a record budget deficit, which cost Brazil its investment-grade credit rating last year.

An upturn in corporate investment in the second quarter provided a glimmer of economic hope for Temer and economists expect a return to growth before the end of the year.

Brazil’s stocks and real currency slightly accelerated gains following the Senate’s decision but the reaction was muted as most traders were already counting on the result. Market analysts said investors would now be looking to Temer to quickly deliver on his promises of reform, notably a constitutional change to limit spending increases in coming years.

“What changes now, with Temer definitively confirmed, is that the pressure will increase on him to deliver,” said Newton Rose, chief economist at Sulamerica Investimentos. “The honeymoon is over, and the market wants to know now how capable he is to govern and put the government accounts in order.”

For more on corruption scandals, watch Fortune’s video:

Temer’s government risks entanglement in the ongoing investigation into kickbacks at Petrobras, which ensnared dozens of politicians in Rousseff’s coalition. Three of Temer’s ministers have already had to step down due to links to the scandal, which could hobble efforts to restore confidence.

Rousseff became the first Brazilian leader dismissed from office since 1992, when Fernando Collor de Mello resigned before a final vote in his impeachment trial for corruption.