Mexican police say they are now in control of the town of San Salvador Atenco after a day of clashes with locals armed with machetes.
Six police officers taken hostage by the rioters had been released, state of Mexico officials said on Thursday.
A teenage boy was killed and dozens of people were injured in the riots which lasted throughout Wednesday.
The violence erupted when three street vendors were arrested on suspicion of trading without permits.
Local residents are then reported to have attacked police with machetes and petrol bombs, and blocked the main road.
Police fired tear gas into the crowds and used batons. Dozens of protesters were arrested - among them a prominent peasant movement leader, Ignacio del Valle.
Boy's death 'unclear'
Local reports say up to 50 police officers were injured in the clashes - a number of them seriously.
Up to 50 police are reported to have been wounded
Six of them were taken hostage by the armed protesters, who later handed them over to the Red Cross.
Officials in the state, which borders Mexico City, said the circumstances surrounding the death of a 14-year-old boy were unclear.
Police said they had managed to make it into the centre of town at about 0700 (1200 GMT) on Thursday and had re-opened the road.
An estimated 4,000 federal and state police are reported to be in Atenco area.
The town was the scene of violent protests in 2002, when local farmers opposed the construction of a new international airport for Mexico City.
Plans for the airport were cancelled after days of pitched battles with police.