This is a huge moment for Brazil.

Ex-President Jair Bolsonaro has been convicted of attempting a coup and leading an armed criminal group after losing the last election, which culminated in his supporters attacking government buildings.

He now faces a lengthy prison sentence, after Brazil's Supreme Court reached the majority of three votes needed to find him guilty.

For years, Bolsonaro has fiercely divided the country into those who love him and those who hate him.

His supporters, who include President Donald Trump, have described the trial as political persecution. Trump used it as an excuse to impose 50% tariffs on Brazil.

His critics have praised the proceedings as necessary to bring closure, and to set a precedent that trying to undermine democracy will not be tolerated.

This ruling is likely to divide the country further.

This trial has gripped Brazil, as millions have seen it live-streamed on social media and television into their homes. And the story line has been no less dramatic than a TV series.

Many people may remember the shocking moments when thousands of Bolsonaro supporters attacked government buildings on January 8, 2023, in scenes reminiscent of the January 6 Capitol riots in the US two years before.

But throughout the course of this trial, many gobsmacking pieces of evidence have been revealed in court.

These include a plan, drafted by Bolsonaro's allies, for elite armed forces personnel to assassinate the president-elect Luiz Inacio 'Lula' da Silva, his running mate, and the Supreme Court judge Alexandre de Moraes, which was printed out at the presidential palace. It listed 'poison' as a method to kill Lula.

Bolsonaro's lawyer was visibly incensed on his client's behalf, arguing there was no evidence linking Bolsonaro to this plot or the January 8 riots.

The court also reminded of Bolsonaro's attempts to cast doubt on the electoral system, including a meeting with foreign ambassadors at the presidential palace where false claims about electronic voting machines were made.

Judges referred to Brazil's young democracy, restored in 1985 after a military dictatorship, as a reminder of the dangers posed by such actions.

In a chilling statement, the judge leading the case warned that Brazil risked 'slowly forgetting' the lessons of its history.

Bolsonaro is yet to receive his sentence but could face life imprisonment. While he may appeal, any appeal must be resolved before he can be imprisoned.

Concerns about his health and the potential for amnesty further complicate the situation. The recent decision could signify a pivotal change in Brazilian politics, scrutinizing action against threats to democracy.