At least two people were killed and 10 hurt in Chile, where thousands of terrified residents rushed out onto the streets in the capital Santiago. The quake was felt as far away as Argentina, where buildings also swayed.
The United States Geological Survey (USGS) put the shallow offshore quake at a magnitude of 8.3 and said it hit just 228 kilometers north of Santiago, a city of 6.6 million people.
The quake, which struck at 7:54 pm (2254 GMT), hit at a depth of eight kilometers, USGS said. Seismologists also reported two aftershocks, both above 6.0.
Interior Minister Jorge Burgos said that the evacuation of coastal towns and cities was ordered as a precautionary measure.
Also Read
The quake was felt as far away as Buenos Aires, about 1,400 kilometers away, while a tsunami warning was initially in place for the whole of Chile and Peru's Pacific coastline.
The two dead were a woman in Illapel, close to the epicenter, and an 86-year-old man in Santiago, where there were scenes of pandemonium as thousands fled swaying buildings.
"We fled our building and everything started to move very strong," resident Pablo Cifuentes told local Cooperativa radio.
A similar fear seized residents in Argentina, while El Salvador, in Central America, was also on the lookout for destructive waves.
"We went into a panic and the floor kept moving. We went out into the hallway and down the stairs," Celina Atrave, 65, who lives in a 25-story high-rise near downtown Buenos Aires, told AFP.
The Hawaii-based Pacific Tsunami Warning Center said that "hazardous" tsunami waves were possible for some parts of Chile's shoreline, including above three meters (10 feet) the tide level.
The precautionary alert for Peru was later called off, civil defense officials said, but scared residents in the city of Ilo, close to the border with Chile, remained out on the streets and on higher ground nonetheless.