Brazil's Senate removed leftist President Dilma Rousseff from office on Wednesday for breaking budgetary laws.
Senators voted 61-20 to strip Rousseff of the presidency for illegally using money from state banks to boost public spending.
But it's not all doom and gloom as Rousseff will be able to keep her political career alive after the results of a second, separate vote came in.
Senators voted on whether Rousseff will be barred from public office for eight years, but the 42 to 36 vote did not get the two-thirds majority needed to implement the ban.
This means Rousseff can run for president in Brazil's next elections.
But for now, her conservative former Vice President Michel Temer, who has run the country since her suspension in May, will be sworn in to serve out the remainder of her term which ends in 2018.
Brazil's first female president denies any wrongdoing and said the impeachment process was aimed at protecting the interests of the country's economic elite.
A tricky transition will now fall on Temer.
He has vowed to pull the economy out of its worst recession since the 1930s and implement austerity measures to plug a growing budget deficit that cost Brazil its investment-grade credit rating last year.
The overwhelming vote does not mean an easy path ahead for Temer, as there are signs of clear resistance in Congress to his proposals to cap public spending and reform public pensions.
His government also risks entanglement in a sweeping investigation of kickbacks at state oil company Petrobras that already ensnared dozens of politicians in Rousseff's coalition.
The scandal, which has tarnished Temer's fractious Brazilian Democratic Movement Party, could hobble efforts to restore stability to Brazil's politics and confidence in its economy.
Temer was so sure of the outcome that he scheduled an address to the nation on Wednesday.
He then plans to fly to China for a summit of the G20 group of leading economies, hoping to secure pledges of trade and investment, his aides say.
Rousseff's popularity fell into single figures this year due to the Petrobras graft scandal and the deep recession that many Brazilians blame on her government's interventionist policies.
In an emotional speech on Monday, Rousseff compared the trial to her persecution under Brazil's 1964-1985 military dictatorship, when she was tortured by security services as a member of a leftist urban guerrilla group.
If the Senate convicts Rousseff, she would become 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.