Supporters in Brazil's capital cheered as President Jair Bolsonaro spoke on Tuesday to mark the country's Independence Day.
He mostly criticized the country's Supreme Court.
It's authorized investigations into Bolsonaro and his allies, and has resisted his attempt to introduce new voting laws in next year's election, which he says is vulnerable to fraud.
But Bolsonaro's critics contend he's sowing doubts in the country's democracy and opinion polls now show him losing dramatically to former President Luiz Inacio Lula da Silva, who has yet to confirm his candidacy.
Crowds for and against Bolsonaro hit the streets across Brazil on Tuesday in cities like Brasilia, Sao Paulo and Rio de Janeiro.
Security forces were deployed to control the crowds of supporters in Brasilia.
Some of which have vowed to occupy the Supreme Court in a protest modelled after the assault on the U.S. Capitol by supporters of then-President Donald Trump.
In Sao Paulo, anti-Bolsonaro protesters called for the end of his presidency.
"I think we have to be here to fight for Bolsonaro's impeachment now, we can't wait until 2022."
They also voiced concerns over Bolsonaro's handling of the global health crisis, holding signs calling him "genocidal."
Meanwhile, in the same city, his supporters marched to remove Supreme Court justices.
"People are tired, I think we are here to get rid of the corrupt people who have only caused damage to us. I support Bolsonaro."
Bolsonaro's longstanding support among the police and military has fueled concerns that uniformed officers could take part in demonstrations or fail to contain potential attacks on government buildings.