Former Brazilian President Jair Bolsonaro has claimed he has been a victim of political persecution since leaving office just over a year ago.
He told tens of thousands of supporters in São Paulo that coup allegations against him were a "lie".
He also called for an amnesty for hundreds of his supporters convicted for attacks on public buildings.
Police are investigating whether Mr Bolsonaro incited a failed coup after losing the 2022 election.
Addressing Sunday's rally in Brazil's largest city, the 68-year-old former president dismissed the allegations against him as politically motivated.
He said it was time to forget the past and let Brazil move on.
He also used his speech to talk about the next presidential elections in 2026.
Mr Bolsonaro is still barred from running for office for eight years for undermining the electoral system in Brazil and claiming the last election was fraudulent, despite there being no evidence of electoral fraud.
Huge crowds wearing yellow and green - the colours of the Brazilian flag - gathered to hear Mr Bolsonaro speak. Those I have spoken to say they are here demonstrating for freedom, and in particular freedom of speech.
They criticise what they see as threats to put Mr Bolsonaro in prison for "saying his opinion".
Several of his supporters at the rally repeated unproven claims that the last election was fraudulent. He had asked them not to bring posters saying this or criticising institutions like the Supreme Court.
Alexandre França, a 53-year-old commercial director, told the BBC many people gathered for the rally because "we must express what we want for our country.
"Today everyone is afraid of being repressed. So I think we're here to show our faces. We want Brazil for everybody, freedom for everybody," he added.
Rogério Morgado, a 55-year-old military official, was another rally participant interviewed by the BBC. He said: "Brazilian politicians are afraid of people on the streets, it's the only thing that Brazilian politicians are afraid of."
Mr Bolsonaro's speech is being watched closely by the authorities for anything that could be seen as inciting riots or undermining the electoral system.
Earlier this month, the former president had to surrender his passport as he is facing an investigation over the accusations that he tried to overturn the October 2022 election results and pressure military chiefs to join a coup attempt.
After he lost the poll to the left-winger Luiz Inácio Lula da Silva, thousands of his supporters stormed government buildings in the capital Brasília - including the presidential palace, the Supreme Court and Congress - looting and vandalising the buildings.
Three of Mr Bolsonaro's allies have since been arrested, and the head of his political party has also been detained.
Police accuse them of spreading doubts about the electoral system, which became a rallying cry for his supporters.
This, police argue, set the stage for a potential coup. When it failed to get the support of the armed forces, however, his frustrated supporters stormed Congress, the building housing the Supreme Court and the presidential palace, on 8 January last year.
Mr Bolsonaro was in the US when the attack on Congress happened. He returned to Brazil in March 2023, saying he had nothing to fear.
He remains the most influential figurehead for the right in Brazilian politics.