The crowd of around 600 called on the army to intervene in the handling of the coronavirus pandemic and demanded the closure of Congress.
Some held up posters declaring "Military intervention with Bolsonaro".
"I am here because I believe in you and you are here because you believe in Brazil," the president told the crowd from the back of a pick-up truck.
Bolsonaro, a former army captain, has constantly criticized partial quarantine measures adopted by governors, including those in charge of the country's most populous states, Sao Paulo and Rio de Janeiro, to halt the spread of the coronavirus.
On Friday, he sacked his health minister, who supported the restrictions that Bolsonaro says are damaging the economy.
Brazil, with a population of more than 200 million, has the most COVID-19 cases in Latin America -- more than 38,000 as of Sunday, with more than 2,400 deaths.
During his address, which was interspersed with fits of coughing, the president made no response to the crowd's call for military intervention nor the demand to close Congress.
"You must fight for your country. Count on your president to do what is necessary so that we can guarantee democracy and what is most dear to us, our freedom," Bolsonaro said.
The most populous states of Sao Paulo and Rio de Janeiro on Friday extended partial quarantine measures.
A majority of Brazilians approve the government's confinement regulations despite its impact on the economy, according to a poll published Saturday.