About 1 million people were evacuated from affected areas, said Ricardo Toro, director of the National Office of Emergency.
Fatalities included a woman killed by a falling roof and a second one fatally hit by flying rocks, President Michelle Bachelet said.
The quake's epicenter was 46 kilometers (29 miles) west of Illapel, according to a preliminary assessment from the U.S. Geological Survey.