Officials said the dead included people who were crushed by collapsing walls or were killed by heart attacks.
The US Geological Survey said the quake was shallow at 12.5 miles (20.1 km) below the seabed and struck about 100 km northwest of the mining port of Iquique near the Peruvian border.
The government said it had no reports of significant damage to coastal areas, but around 300 prisoners took advantage of the confusion and escaped from a female penitentiary in Iquique, Interior Minister Rodrigo Penailillo said.