Thousands of Chileans returned to their homes yesterday after spending the night on hills following a powerful 8.2-magnitude earthquake that killed six people and sparked tsunami alerts as far as Japan.

Police and soldiers patrolled the streets to prevent looting after Tuesday’s shallow quake in the north of the country, and in the chaos some 300 inmates escaped after the wall of a women’s prison collapsed in Iquique, the city closest to the huge quake’s epicenter.

Authorities said 110 of them had been recaptured, while copper prices in the major mining country jumped to a three-week high after a series of strong tremors caused nearly one million people to evacuate their homes along the coast.

Chilean television showed sagging roofs, broken windows and shelves and merchandise on the floor at shopping centers in Iquique, located about 1,800 kilometers north of the capital Santiago.

Some 2,000 homes were damaged in the town of Alto Hospicio, near Iquique, the National Emergency Office said.

Thousands of people slept in the open on hills surrounding the city during the night. They returned home after authorities lifted the tsunami alert 10 hours later.

Similar evacuation warnings were issued in a ripple effect up the Pacific coast of South America and into Central America.

Tremors were felt in Peru and as far inland as landlocked Bolivia.

Across the Pacific, Japan issued an alert over the risk of a tsunami of up to three feet. The waves were expected to hit Fukushima prefecture, which was devastated by a 2011 tsunami, Kyodo News agency reported, though little or no damage was anticipated.

In Indonesia, officials said that the Asian nation could be hit by waves of up to half a meter.

“The earthquake was quite violent. The hardest was spending the night outside,” Christian Martinez, a school director who returned to survey his classrooms in Iquique for any damage, told Channel 13 television.

Six people — five men, including a Peruvian, and one woman — were killed in Iquique and the nearby Alto Hospicio municipality. Authorities earlier said four men and two women had died.

Another nine people were injured in neighboring Peru, where homes were damaged.

President Michelle Bachelet declared parts of northern Chile disaster zones and traveled to Arica and Iquique to survey the damage and lead relief efforts.

comment COMMENT NOW