Jair Bolsonaro, the former president of Brazil, 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.
Bolsonaro led Brazil from January 2019 to December 2022.
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 sole dissenting voice on the five-member panel was Luiz Fux, who argued in an 11-hour speech that the accusations against Jair Bolsonaro were unfounded and voted for him to be acquitted.
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.
He had already been barred from public office on separate charges. He has also called it a "witch hunt".
Reacting to the guilty verdict, Trump said he found it "very surprising" and compared it to his own experience.
"That's very much like they tried to do with me. But they didn't get away with it at all." Trump statesd.
Bolsonaro, who is 70, now faces the prospect of spending the rest of his life in prison.
His lawyers are expected to argue that he should be kept under house arrest instead of being sent to jail - as well as plead for a lower sentence.
They have also said that they will appeal against his conviction but legal experts have said this may prove difficult, as this is normally only possible if two out of the five justices have voted to acquit.
Bolsonaro was found guilty of five charges, all relating to his attempt to cling to power after he was beaten in the 2022 election.
But prosecutors said he had started to plot to stay in power long before, proposing a coup to military commanders and sowing unfounded doubts about the electoral system.
They also said that Bolsonaro knew of a plan to assassinate Lula and his vice-presidential running mate, as well as a Supreme Court Justice.
The justices found he had led a conspiracy and also convicted seven of his co-conspirators, including senior military officers.
Among them are two former defence ministers, a former spy chief and former security minster.
While the plot failed to enlist enough support from the military to go ahead, it did culminate in the storming of government buildings by Bolsonaro's supporters on 8th January 2023, the justices found.
Order was quickly restored and more than 1,500 people were arrested.
Â