The quake had a preliminary magnitude of 5.5. A magnitude-5 earthquake can cause considerable damage.
Salvadoran government officials warned people to evacuate areas made vulnerable by five days of heavy rains blamed for 67 deaths.
The quake also was felt in neighboring Guatemala, where 150 people have died from flooding and landslides caused by heavy rains.
The earthquake was centered in the Pacific Ocean, 35 miles southwest of San Salvador, just offshore, according to the National Earthquake Information Center (search) in Golden, Colo.