Revolts in 70 jails in the Brazilian state of Sao Paulo have come to an end, after spawning four days of violence in which at least 81 people died.
Police are patrolling Sao Paulo city after gangs apparently directed by prison inmates attacked police stations and banks, and torched dozens of buses.
The state government refused a federal offer to send in 4,000 elite troops.
The unrest was triggered when hundreds of imprisoned members of a gang were sent to maximum-security prisons.
President Luiz Inacio Lula da Silva called the violence "a provocation, a show of force by organised crime".
'We're at war'
Some 200 prison guards and visitors held taken hostage over the weekend have now been released.
The uprisings that struck some 70 prisons across the state and were reported in prisons in some neighbouring states are now said to have been quelled.
Outside the jails, police made about 100 arrests, and seized a similar number of guns.
"We're at war with them, there will be more casualties, but we won't back down," said state military police chief Col Elizeu Teixeira Borges.
Police say that while most of Friday and Saturday's casualties were prison guards and police officers, most of those who died overnight from Sunday to Monday were suspected gang members.
The streets of Sao Paulo, with 18 million inhabitants South America's largest city, were eerily deserted on Monday night.
Shops normally open until midnight or later were closed by nightfall, and employees were sent home early.
"I'm scared with all these attacks and there's no police on the street," Maria, a waitress who was waiting for one of the few buses in circulation, told the AFP news agency.
Many bus drivers were said to be refusing to work after at least 60 buses were torched by gang members, who ordered the passengers off. That left an estimated 2.9 million people scrambling to find alternative routes to work.
Molotov cocktails were hurled into several bank branches and across Sao Paulo city, police stations again came under attack by gangs wielding machine guns, machetes and home-made bombs.
There were also several fatal shoot-outs.
Many worried parents kept their children away from school and businesses closed early to allow employees to reach home before dark.
But state governor Claudio Lembo refused a federal offer to send troops, saying the army was not necessary.
The violence is said to have been directed from prison cells by leaders of the First Command of the Capital (PCC) criminal faction.
Founded in 1993, the PCC has been involved in drugs and arms trafficking, kidnappings, bank robberies, and prison breaks and rebellions, police say.
The power of the faction has been heightened in recent years by the availability of mobile phones, smuggled through prison security, enabling members to run criminal activities from the safety of their cells.
In November 2003, the gang attacked more than 50 police stations, killing three police officers and wounding 12. Those attacks were thought to have been orchestrated by PCC leaders in jail.
A local public safety official told the Associated Press that authorities had been prepared for a PCC response to the jail transfers but "never imagined it would be so big or ferocious".