The former president of Brazil, Jair Bolsonaro, has been sentenced to 27 years and three months in prison after being found guilty of plotting a military coup.

A panel of five Supreme Court justices handed down the sentence just hours after they had convicted the former leader.

They ruled he was guilty of leading a conspiracy aimed at keeping him in power after he lost the 2022 election to his left-wing rival, Luiz Inácio Lula da Silva.

Four of the justices found him guilty while one voted to acquit him. Bolsonaro's lawyers have called the sentence absurdly excessive and said that they would file the appropriate appeals.

The Supreme Court panel also barred him from running for public office until 2060 - eight years after the end of his sentence.

Bolsonaro, who was put under house arrest after being deemed a flight risk, did not attend this final phase of the trial in person. But he has in the past said it was designed to prevent him from running in the 2026 presidential election - even though he had already been barred from public office on separate charges. He has also called it a witch hunt.

His words have previously been echoed by US President Donald Trump, who imposed 50% tariffs on Brazilian goods, framing them as retaliation for Bolsonaro's prosecution.

Reacting to the guilty verdict, Trump expressed surprise and compared it to his own experiences.

US Secretary of State Marco Rubio described Brazil's Supreme Court ruling as unjust and hinted at potential repercussions for what he viewed as a political attack.

Brazil's foreign ministry rapidly countered these remarks, emphasizing the integrity of their democratic institutions.

Bolsonaro now faces the possibility of spending the remainder of his life in prison. His legal team plans to argue for house arrest in lieu of prison and seek a reduced sentence, but experts warn that appeal avenues may remain limited due to the nature of the ruling.

Bolsonaro was convicted on multiple charges relating to his attempts to retain power post-election, including orchestrating conspiracies and promoting fatal violence against political rivals.

The implications of his plot, though ultimately unsuccessful, stirred significant unrest, culminating in violent rallies on January 8, 2023, a turning point cemented in the court's assessment.

The trial's closing arguments invoked Brazil's fraught history with autocracy and the judiciary's duty to safeguard democracy against authoritarian tendencies.