Protesters in a mining town in southern Peru have released 48 police officers they had been holding hostage after violent confrontations on Monday.
Some 20,000 demonstrators from Moquegua have been demanding a greater share of the taxes paid to the government by Peru's biggest copper producer.
The Catholic Church had given refuge to the men and they were released unharmed. They are now flying to Lima.
Among those held by the protestors was the chief of police in southern Peru.
Twenty-four hours after they were taken hostage by angry protesters in Moquegua, 1,200km (750 miles) south of Lima, the 48 police officers were released safely.
Among them, the chief of police for southern Peru, Alberto Jordan, who was shown earlier on national television surrounded by a crowd, waving a white flag and apologising to the people.
The officers were captured after they tried to disperse protesters blocking a bridge with tear gas, which seemed to provoke them further.
The crowd charged the officers, disarmed them and marched them to the city's cathedral where they were held.
What started as a few thousand protesters blocking roads in and out of the southernmost tip of Peru swelled during the course of the week to a crowd of around 20,000 people.
The Peruvian authorities were forced to ship in food and fuel by sea.
The demonstrators say they want a larger share of the taxes which the operators of the local mine, Southern Copper, pays the central government.
Copper prices have soared on the world market and mining companies in Peru are making huge profits.
The government had suspended talks with local leaders until the hostages were freed. Now the negotiations will resume.
Mining is powering Peru's economy and President Alan Garcia is under pressure to deliver the benefits of the growth to the poor.
The longer he delays the more protests like this will continue to paralyse parts of the country.