A criminal gang in the Brazilian city of Sao Paulo, in a second wave of attacks against police, has killed at least 52 people in what is one of the deadliest assaults of its kind in the nation's history.
Sao Paulo state government officials have reported at least 100 separate attacks on Friday, Saturday and Sunday that killed at least 35 police officers, the girlfriend of one of them, two passersby and 14 suspected gang members.
Inmates were holding more than 229 prison guards hostage on Sunday, after dozens of new prison rebellions broke out, with 41 uprisings under way across Sao Paulo state in the afternoon.
Late on Sunday evening, the Folha de Sao Paulo newspaper's website reported that the toll had risen to 55 and that at least 10 public buses had been burned by bandits in the city of Sao Paulo.
The bloodshed was unleashed by the First Command of the Capital (PCC in Portuguese) gang in retaliation for the transfer of imprisoned gang members to a remote penitentiary. Prisoners have also rioted in 36 penitentiaries, the security office said.
Gilberto Kassab, the mayor of Sao Paulo city, said on Saturday night: "We are all indignant and in a state of mourning. It's not a war. It's a battle, which we will win."
At least 16 suspects have been arrested so far.
A total of 100 attacks have been recorded since the gangsters, armed with grenades and machine guns, first struck on Friday night, hitting police posts and other targets in rich and poor areas of the city and other locations in the state.
The latest wave included the drive-by shooting early on Sunday morning of a police post at Itapecerica da Serra on the Regis Bittencourt highway, a main road running west from the city. Police chased and killed the three attackers, a state security spokesman said.
Police say the violence was launched by the PCC, one of the most powerful of Brazil's organised crime operations, after the authorities transferred 765 prisoners to a new penitentiary 620km from the capital.
The transfer of prisoners, including Marcos Willians Herbas Camacho, or Marcola, the PCC chief, was an attempt to defuse a multi-prison rebellion allegedly planned for this weekend.
Sao Paulo - the country's industrial and business heartland and the world's third-biggest city with about 20 million people - has long been plagued by violent crime.
It is the centre for drug-trafficking in Latin America's largest country, which is a transit point for cocaine destined for Africa and Europe, as well as Brazil's domestic market.
However, the scale of the co-ordinated attacks on Friday and Saturday took police by surprise.
Jose Vicente da Silva, a former public security official, said: "The intelligence services need to anticipate these things so that it can take the necessary measures and stop them from happening. This was a big error."
Links between corrupt police officers and gangs fuelled the problem, he said.
New riots broke out in prisons across the state just as the authorities managed to bring others under control. The state prison service said rioting erupted in 36 of state's 106 prisons.