A quake of 8.2 magnitude has struck off northern Chile, triggering a tsunami alert and killing at least five people.
The US Geological Survey said the quake struck at 20:46 local time (23:46 GMT) about 86km (52 miles) north-west of the mining area of Iquique.
Waves of up to 2.1m (6ft) have hit some areas in Chile, and there have been power cuts, fires and landslides.
Tens of thousands of people were evacuated in affected areas, where a state of emergency has been declared.
Chilean TV broadcast pictures of traffic jams as people tried to leave.
Officials said the dead included people who were crushed by collapsing walls or died of heart attacks.
Iquique Governor Gonzalo Prieto told local media that in addition to those killed, several people had been seriously injured.
While the government said it had no reports of significant damage to coastal areas, a number of adobe homes were reported destroyed in Arica.
Further damage may not be known until dawn. The tsunami warning in Chile will last at least until 08:00 GMT.
The quake shook modern buildings in Peru and in Bolivia’s high altitude capital of La Paz – more than 470km (290 miles) from Iquique.
At least eight strong aftershocks followed in the few hours after the quake, including a 6.2 tremor.
The Chilean interior ministry told the BBC that one of the main roads outside Iquique was cut off because of hillside debris.
The ministry says that partial landslides have also taken place between the towns of Putre and General Lagos.
The interior minister also told Chilean TV that some 300 women inmates had escaped from a prison in Iquique. The authorities are reported to have deployed a planeload of special forces to guard against looting.
Chilean Interior Minister Rodrigo Penailillo said President Michelle Bachelet was being kept informed. She is to travel to the affected area.
“We have taken action to ensure public order in the case of Iquique, where we’ve had a massive escape of more than 300 female prisoners, so that the armed forces and police can coordinate and provide security to the residents,” he said.