The tremors resulted in the evacuation of buildings and landslides, officials said, adding they were felt as far away as El Salvador.