Riot police detain a man during an anti-impeachment protest in Sao Paulo, Brazil, on Sunday. (Fernando Donasci/Reuters).

RIO DE JANEIRO — A peaceful rally in Sao Paulo on Sunday afternoon to protest the impeachment of Brazilian President Dilma Rousseff and call for elections ended in violence hours later amid widespread accusations of police brutality.

Cellphone videos of panicked protesters fleeing clouds of tear gas and a BBC Brasil reporter apparently being knocked over by riot police have raised concerns that further demonstrations, including those planned for Wednesday — Brazil's independence day — may be marred by violence.

Many fear a repeat of 2013, when violent protests roiled Brazil and masked youths fought pitched battles with police in Rio and Sao Paulo for months afterward.

Rousseff was ousted from office by the Brazilian Senate on Thursday after an impeachment trial that she and her leftist supporters labeled a parliamentary coup. She was replaced by former vice president Michel Temer. He first took over as interim president when Rousseff was suspended in May and has been trying to introduce austerity measures and a more conservative agenda.

News of Rousseff’s ouster prompted protests marked by vandalism and heavy police repression in Sao Paulo and other cities. After a protest in Sao Paulo on Wednesday, local media reported that a woman lost sight in one eye, which was perforated by fragments after a percussion grenade thrown by police exploded near her.

Now the fear is that events could escalate again — as happened three years ago, when hundreds of thousands took to the streets to protest public services, corruption and World Cup spending. A Brazilian cameraman was among several people killed before the demonstrations petered out months later. But those protests were anti-establishment and not aimed at any one party, while many of the same groups involved this time around have sided with Rousseff's Workers' Party.

Like a smaller march earlier on Rio's Copacabana seafront that went off without incident, Sunday’s march in Sao Paulo, led by politicians from the Workers’ Party and its allies, was supposed to be nonviolent. Its organizers, including political parties, unions and left-wing groups, claimed that 100,000 people attended.

Local media and activist sites carried images of crowds flooding down the city’s main Paulista Avenue to the Largo da Batata Square in the nearby Pinheiros neighborhood. A video of protesters singing “Temer Out” to the tune of Handel’s "Messiah" had been watched, at the time of publication, about 220,000 times on the Facebook page of an independent media network called Jornalistas Livres — or Free Journalists.

But as the demonstration dispersed peacefully, police began throwing tear gas at the crowd, said Paulo Teixeira, a Workers’ Party lawmaker who was at the protest.

“The demonstration had happened. It was at the end. Suddenly, the police began throwing tear gas bombs into the square. It was a panic,” Teixeira said. “Everyone left running because tear gas goes into your respiratory system and your eyes.”

A video from the Globo media network’s G1 news site shows panic spreading among demonstrators as tear gas was fired, with people cramming into a nearby metro station to escape the fumes.

In this video, a reporter from BBC Brasil appeared to be knocked over by riot police during the ensuing confusion and violence, even as he shouts, “Press!” He then explains in Portuguese that police had struck him on his hands, arms and chest even after he identified himself. He says protesters also threw bottles at police. The video has been watched about 350,000 times on the BBC Brasil website.

This video of a man being arrested by police after the demonstration has garnered tens of thousands of views after being uploaded on the site of an independent media network called Mídia Ninja.

Mídia Ninja also shared this video from the Plantão Brasil Facebook page of a demonstration in Belem, capital of the Amazon state of Para, in which a police officer appears to fire a rubber bullet at the head of a protester.

A spokeswoman for the Para state government said that two officers were injured by rocks thrown by protesters during a demonstration on Friday and that police had used all means at their disposal — including rubber bullets and tear gas — to stop anybody else getting hurt.

Sao Paulo’s Secretariat of Public Security said in a statement on its website that authorities had arrested 16 masked demonstrators Sunday — some near the metro station close to where the trouble began and others nearby — and recommended charges against them for criminal association. "Diverse objects used in acts of vandalism" were found with those arrested, the statement said.

In a video on a government website, a police officer, Maj. Genivaldo Antonio, said police dispersed the crowd after bottles were thrown at them at the end of the demonstration.

Police also published photographs of slingshots, gas masks, plastic bottles containing an unidentified liquid and cellphones that they said were seized from those arrested. Ten minors also were arrested, the secretariat's statement said.