Organizers estimated turnout at 100,000, while police said it was closer to 20,000. Either way, it was the largest protest held in Brasilia on Wednesday since Bolsonaro took office in January, Efe news reported.
Participants expressed opposition to the government's agriculture policy, which favors large-scale producers over family farmers, and to the president's plan to cut back regulation of mining in Amazonia, home to most of Brazil's indigenous reserves.
Also targeted for criticism was Bolsonaro's extensive history of making misogynistic, homophobic and racist statements.
Polls show support for the former army officer and apologist for Brazil's 1964-1985 military regime at around 30 per cent, down from more than 55 per cent in January.
The progressive opposition, largely quiet until now in light of the right-wing majority in Congress, appeared to find its voice with Wednesday's demonstration.
"We are back," Paulo Pimenta, a lawmaker with the center-left Workers Party (PT), told Efe news.
The great unifying figure of Brazil's fractious left, former President Luiz Inacio Lula da Silva, took part in the event from the jail cell he has occupied since April 2018 on a corruption conviction.
Fernando Haddad, the PT standard-bearer who lost the October 2018 election to Bolsonaro, read aloud from a letter Lula drafted in his cell in the southern city of Curitiba.
"The women of our land will have again the respect and affection they deserve. Hate will not defeat love. Fear will not defeat hope. Brutishness will not defeat solidarity," the 73-year-old former head of state wrote.
Even behind bars, Lula, who governed Brazil from 2003-2011, remains the country's most popular politician.
During his tenure and that of his PT successor, Dilma Rousseff, Lula said, Brazil was "beginning to build a better country, with social inclusion, democracy - freedom to think, to speak, to organize."
Rousseff, a one-time guerrilla who was jailed and tortured by the military dictatorship, served one full term as president and won re-election in 2014 only to be ousted by Congress for alleged budget irregularities in August 2016.
The "political persecution" that put him in jail set the stage for "a Brazil that is governed by hate and the madness of those who flatter the powerful and pretend to be brave in the face of the most defenseless," Lula wrote.
"This difficult moment," he said, is "a pause in the construction of the Brazil that everybody wants: with popular sovereignty, democracy, justice, equality and freedom from violence."
Haddad concluded the reading of the letter with a chant of "Free Lula" and the thousands gathered in front of Congress joined in.
The former presidential candidate also repeated his call for the resignation of Justice Minister Sergio Moro, who, while still a federal judge, convicted Lula and sent him to jail in the context of the sprawling corruption probe known as Lavo Jato (Car Wash).
The Intercept, an online news outlet, published in June the contents of private communications among prosecutors and Moro revealing that the then-judge was deeply involved in shaping the prosecution strategy against Lula.
Prosecutors do not dispute the authenticity of the material, which shows, in the words of The Intercept, "that Moro secretly and unethically collaborated with the Car Wash prosecutors to help design the case against Lula despite serious internal doubts about the evidence supporting the accusations, only for him to then pretend to be its neutral adjudicator."
( With inputs from IANS )