Police used have tear gas to disperse thousands of demonstrators at the end of a peaceful march to protest against the removal of leftist president Dilma Rousseff last week in an impeachment trial.
It was the largest of a wave of demonstrations against new President Michel Temer since the conservative lawyer was sworn in on Wednesday to replace Ms Rousseff for the rest of her term through to 2018.
The marchers, rallied by Left-wing groups and unions aligned with Ms Rousseff's Workers Party, called for new elections and chanted "Out with Temer!" One marcher wore a red T-shirt that said in English: "First of all, Temer must fall."
The organisers said 50,000 people turned out for the march to a square in western Sao Paulo that included families with children, witnesses said.
As the rally ended and demonstrators headed for metro entrances, riot police fired tear gas that caused panic and led to clashes. Police said they were forced to intervene to stop vandalism at the end of a peaceful march.
There were smaller anti-Temer demonstrations on Sunday in Rio de Janeiro, Curitiba and other Brazilian cities.
Mr Temer played down the wave of protests in comments to reporters on the sidelines of a summit of the G20 group of leading world economies in Hangzhou, China.
"They are small groups, not popular movements of any size," he said. "In a population of 204 million Brazilians, they are not representative."