Brazil’s President Luiz Inácio Lula da Silva has vowed to punish supporters of the country’s ex-leader, Jair Bolsonaro, after they stormed Congress.
The dramatic scenes – which saw hundreds of protesters clad in Brazil football shirts and flags – come a week after Mr da Silva’s inauguration.
Police in the capital, Brasilia, used tear gas but failed to repel the crowd.
Supporters of the ousted far-right leader also stormed the Supreme Court and surrounded the presidential palace.
Mr Bolsonaro has repeatedly refused to accept that he lost October’s election and last week left the country instead of taking part in inaugural ceremonies, which would have seen him hand over the iconic presidential sash.
Mr da Silva – better known as Lula – said there was “no precedent in the history of our country” for the scenes seen in Brasilia and called the violence the “acts of vandals and fascists”.
And he took aim at security forces whom he accused of “incompetence, bad faith or malice” in the failure to stop demonstrators accessing Congress.
“You will see in the images that they [police officers] are guiding people on the walk to Praca dos Tres Powers,” he said. “We are going to find out who are the financiers of these vandals who went to Brasilia and they will all pay with the force of law.”
Video shared by the Brazilian outlet O Globo showed some officers laughing and taking photos together as demonstrators occupied the congressional campus in the background.
Some protesters smashed windows, while others reached the Senate chamber, where they jumped on to seats and used benches as slides.
Footage on social media shows protesters pulling a policeman from his horse and attacking him outside the building.
It is unclear if they are still in the building, but footage broadcast by national media showed police detaining dozens of protesters in their yellow jerseys outside the Presidential Palace.
Other suspects – whose hands were bound behind their backs – were also seen being led out of the building.
Protesters had been gathering since morning on the lawns in front of the parliament and up and down the kilometre of the Esplanada avenue, which is lined with government ministries and national monuments.
Security had appeared tight, with the roads closed for about a block around the parliament area and armed police pairs guarding every entrance into the area.
The BBC saw about 50 police officers around on Sunday morning local time and cars were turned away at entry points, while those entering on foot were frisked by police checking bags.
Demonstrators were quick to defend their actions when approached by reporters.
Lima, a 27-year-old production engineer, said: “We need to re-establish order after this fraudulent election.”
“I’m here for history, for my daughters,” she told AFP news agency.
Many are drawing comparisons with the storming of the US Capitol on 6 January 2021 by supporters of Donald Trump, an ally of Mr Bolsonaro. (BBC)