Thousands of Guatemalan security forces have stormed a prison that has been under prisoner control for 10 years, killing seven inmates.
Prisoners responded to the raid with guns, grenades and knives, but were overpowered and taken to another jail.
The jail had been run by a prisoners' committee that turned over tens of thousands of dollars monthly, and paid for a luxury lifestyle for top inmates.
Guatemala's president visited the jail and declared the operation a success.
"Fortunately it went well," said President Oscar Berger.
"We thought there would be more regrettable incidents, although we regret the deaths of the seven inmates and the wounded policeman," he said.
"It is degrading, inhuman and a mess here - totally without authority," he added, explaining why 3,000 troops and police were ordered to raid the Pavon facility.
Among those killed in the raid was the leader of the prisoners' organisation - the "Order and Discipline Committee" - Luis Zepeda.
The convicted murderer earned around $25,000 (£13,000) a month from activities that included renting out parts of the prison grounds for other inmates to build houses on, police said.
His son Samuel lived voluntarily within the prison walls to help run the family empire, even though he had not been sent to prison, Reuters news agency reported.
After the confrontation, army helicopters flew overhead and armoured cars were stationed round the prison as the authorities imposed a local state of emergency.
A puppy that had belonged to a prisoner wandered whining through the compound as security forces surveyed the scene.
Since prisoners took control in 1996, they had reportedly built shops, restaurants, churches - both Catholic and evangelical - and cocaine laboratories.
Some of the top prisoners lived in houses they had had built outside the main prison buildings.
The prison population had grown to twice its intended size
One two-story wooden chalet, complete with widescreen television and high-speed internet link, was left spattered with blood after its owner - a convicted Colombian drug trafficker knows as "El Loco", or "The Madman" - was killed in the raid.
"The people who live here live better than all of us on the outside. They've even got pubs," one soldier told Reuters.
Pavon was built for 800 inmates on the edge of the town of Fraijanes, 25km (15 miles) east of the capital Guatemala City.
It was intended to be a farm prison, where prisoners could grow their own food, but grew until 1,600 people were housed there.
A prisoners' committee was formed in 1996 to involve the inmates in running the prison.
But it quickly spun out of control until government forces controlled only the prison perimeter.
Police said that in the hours after the raid they had already recovered 150 firearms.
"This is a Pandora's box that is only beginning to be opened," said Guatemala's national director of prisons, Alejandro Giammatei.