Brazil's Congress has overturned a veto of a bill that would dramatically reduce former president Jair Bolsonaro's prison sentence for plotting a coup after he lost the last election.

Last year Bolsonaro was sentenced to 27 years in jail for his attempt to cling to power after losing the 2022 elections to Luiz Inacio Lula da Silva.

Lula had tried to block a subsequent push by the conservative-majority Congress to reduce Bolsonaro's term to just over two years, but in a tense session on Thursday lawmakers overrode his veto of a law changing how prison sentences are calculated.

The law could still be challenged in the Supreme Court.

Bolsonaro, 71, was in March allowed to temporarily be placed under house arrest due to ill health.