Police in Ecuador say they have taken back control of the main prison in the capital and others across the country.
The mutiny began during a strike by prison guards
More than 300 officers entered the Garcia Moreno jail in Quito without any resistance from inmates, they said.
The prisoners seized control 10 days ago, demanding better living conditions and shorter sentences.
At least three prisoners died and 40 were injured in fighting between rival groups. Many escaped through the sewers of Garcia Moreno jail on Tuesday.
Six have reportedly been recaptured.
The prisoners are hoping the Ecuadorean Congress will pass a bill granting them remission of sentences for good conduct and compensation for the extreme overcrowding in jails.
Ecuador's 33 prisons were built to house 6,000 prisoners, but actually hold 12,600, the AFP news agency reports.
Police stormed the Garcia Moreno jail in Quito a day after inmates at a women's prison released the remainder of about 130 visitors they had been holding hostage - including television journalists sent out to interview them.
Prisoners at the Garcia Moreno jail had also taken about 150 hostages, but released them last week.
"We can say that everything is under control... peacefully. The use of force was not necessary," police Gen Rodrigo Hinojosa told reporters.
Mr Hinojosa said police would find out how many inmates had escaped on Tuesday night.
Considerable damage has been caused
Shattered glass was strewn throughout the jail, doors had been ripped from the walls and files and computers from prison offices had been destroyed, Reuters news agency reported.
Interior Minister Raul Baca said other prisons taken over by inmates during the rioting were also now under control.
"I don't know how many [inmates] have fled or were killed or wounded. We won't know this until the operation is over," Mr Baca said.
The troubles began during a strike by prison guards demanding back pay and improvements.
After more than 300 people were held hostage at an Ecuadorean prison in February, the government promised to build three new prisons to ease overcrowding, and to release some 1,000 people being held without sentence.
But Mercedes Torres, a leader of the protest at the women's jail in Quito, said the government had made little effort to fulfil its promises.