By Vanessa BuschschlüterBBC News Online Latin America editor
ReutersRioters were brandishing the Brazilian flagThousands of supporters of Brazil's former President Jair Bolsonaro have stormed the country's Congress, the Supreme Court and the presidential palace.
Wearing shirts in the bright yellow and green of Brazil's flag they vandalised the buildings that house its key democratic institutions. Why is this happening?
Brazil held a bitter election two months ago
The presidential elections in October 2022 pitted the far-right incumbent, Jair Bolsonaro, against his left-wing rival, Luiz Inácio Lula da Silva, better known known as Lula.
Following an acrimonious and bitter campaign, Lula, who was president between January 2003 and December 2010, defeated Mr Bolsonaro by a narrow margin in the run-off on 30 October.
Lula said the storming was "without precedent" and labelled those behind it "fanatic fascists".
He also accused Mr Bolsonaro of encouraging the rioters' actions via social media. "Everybody knows there are various speeches of the ex-president encouraging this," he said.
It is a profoundly divided country
Brazil is a country which is deeply divided and the storming of its Congress is a dramatic sign of how far some Brazilians are willing to go to attack the democratic institutions which they say no longer represent them.
This is not just about left versus right, but about those who refuse to accept the result of a democratic election when it goes against their will, taking out their rage on the symbols of Brazil's democracy.
Those who took part in the rioting are on the extreme end of the spectrum but there are many more opponents of Lula who spread false information about him and thereby fanned the flames which led to Sunday's events.
For some, Lula's path from prisoner to president is too much
While Lula has served two presidential terms, he has also served a prison term and some Brazilian say it is "shameful" he should have returned to the presidential palace after his time in jail.
Lula spent 580 days in jail after being convicted of corruption in 2017 and was banned from running in the 2018 presidential election, which Mr Bolsonaro ended up winning.
His conviction centred around allegations that he had accepted a bribe from an engineering company - in the form of renovations to a beachfront apartment - in return for helping the firm secure contracts with Brazil's state-run oil company.
Lula denied ever owning the apartment. His conviction was later annulled and he was cleared to stand for office again.
But many of Lula's critics argue that even though Brazil's top court quashed his conviction that does not mean he was innocent. They point out that the conviction was annulled on procedural grounds.
Lula supporters, on the other hand, say the case against Lula was political.
Their view was backed up when Brazil's Supreme Court ruled that the judge behind it, who later became a minister in the Bolsonaro government, had been biased in the way he oversaw Lula's trial.
Many Bolsonaro supporters refuse to accept his defeat
Many of Jair Bolsonaro's supporters saw him as a "saviour" who they said defended values they hold dear, which they listed as "God, fatherland, family".
ReutersBolsonaro supporters often pray during their protests and vigilsThey placed their hope in Mr Bolsonaro as the man who would defeat Lula, whom they consider a threat to those values, believing false rumours that the left-wing candidate would close down churches once elected.
These voters had been convinced that Lula would lose and they did not accept his win quietly.
Some camped out in front of military barracks begging the military to stop him from becoming president, even if that would mean a military coup.
However, the military did not act and Lula was sworn in as planned.
Lula moved into the presidential palace. It made some Bolsonaro supporters snap
The rioting in the capital, Brasilia, comes just a week after Lula was sworn into office.
ReutersJair Bolsonaro refused to attend Lula's swearing-in and did not hand over the presidential sashMr Bolsonaro, who refused to concede defeat, did not attend the ceremony, instead flying to the United States.
The anger of those who had pinned all their hopes on Mr Bolsonaro beating Lula only grew.
Seeing Lula take office and move into the presidential palace was too much for those who routinely label him a "communist threat to Brazil".
Feeling let down by the military, they decided to take matters into their own hands, invading the institutions they feel not only do not represent them, but are, in their eyes, a direct threat to what they hold dear.
Extremism and disinformation have taken on a life of their own
Jair Bolsonaro's divisive rhetoric and his questioning of the validity of Brazil's electoral system contributed in large part to the anger on display in Brazil on Sunday.
In the run-up to election, he repeatedly claimed that Brazil's electronic voting system was vulnerable to fraud - a claim dismissed by the electoral authorities.
But many Brazilians wrongly believe the election was "stolen" even though a challenge lodged by Mr Bolsonaro's party was rejected by the electoral court.
Following the rioting, Jair Bolsonaro took to Twitter to reject the accusation made by Lula that he had made several speeches encouraging the unrest in Brasilia.
He said that "pillaging and invasions of public buildings as occurred today" were outside the law.
But the extremism of those who stormed the country's democratic institutions has taken on a life of its own which will be hard to rein in.
BBC in other languagesInnovationncG1vNJzZmivp6x7o67CZ5qopV%2Bjsri%2FjrCmq6SUYrmiwMinZJqllae2pK2Mb2traGZnf3E%3D