A Brazilian politician threw grenades at federal police officers who tried to arrest him, sparking an hours-long siege on Sunday.

Roberto Jefferson, former government official and supporter of the president Jair Bolsonaroalso fired a rifle at police officers, injuring two, in the municipality of Comendador Levy Gasparian, in Rio de Janeiro.

Mr Jefferson posted a WhatsApp video message to his supporters in which he said he refused to give up: “I didn’t shoot at anybody to hit them. No one. I shot their car and near them. There were four of them, they were running, I said: “Get out, because I will take you.”

“I am setting an example, I am leaving a planted seed: resist oppression, resist tyranny. God bless Brazil.”

He was taken into custody in the evening, and the arrest took place literally a few days before BrazilThe second round of presidential elections will take place on October 30.

Mr. Jefferson was also arrested for attempted murder, Brazil’s federal police said.

In preparation for the upcoming elections in Brazil, the Supreme Court is working to stop the spread of misinformation and anti-democratic rhetoric.

This has sparked a backlash from Mr Bolsonaro’s committee, which sees the new restrictions as censorship. Among the most vocal critics is Mr. Jefferson, who was preemptively imprisoned for threatening court judges.

In January, Mr. Jefferson was allowed to serve preventive detention under house arrest under certain conditions.

However, Mr. Jefferson repeatedly violated the terms of his house arrest, according to Judge Alexander de Moraes, who ordered him returned to prison.

One such action involved Mr. Jefferson comparing one female justice to a prostitute on social media.

Roberto Jefferson has released a WhatsApp video message to his fans in which he says he refuses to give up

In a live broadcast on social media, Mr. Bolsonaro quickly rejected Mr. Jefferson and criticized his threats against the Supreme Court that led to his first arrest, as well as the subsequent attack on Sunday.

The president also sought to distance himself from his former ally: “There is not a single photo of him and me,” he said, despite the fact that his opponents immediately posted several photos of the two together on social media.

Mr Bolsonaro also said he had dispatched Justice Minister Anderson Torres to the scene, without specifying what his role would be.

Another politician, Daniel Silveira, was similarly convicted by the Supreme Court earlier this year for inciting physical attacks on the judiciary and other authorities. Mr. Bolsonaro quickly pardoned Mr. Silveira and allowed him to appear at his side after his vote in the first round of elections on October 2.

While some may have grown accustomed to far-right politicians and activists disrespecting Supreme Court justices, Mr. Jefferson’s extreme actions still came as a shock to many.

Arthur Lira, the president of the lower house of Congress and an ally of Mr. Bolsonaro, tweeted: “Brazil is watching in horror the events that this Sunday reached the height of absurdity. We will not tolerate setbacks or attacks on our democracy.”

Reaction to the events was mixed, with some hailing Mr. Jefferson as a hero for standing up to the Supreme Court. Dozens even flocked to his home during his arrest to show their support.

Luis Inacio Lula da Silvathe former president, who is in favor of being reinstated, said Mr. Jefferson “doesn’t have adequate behavior. It’s abnormal behavior.”

A run-off vote between Mr Bolsonaro and Mr da Silva is scheduled for October 30.