An earthquake of magnitude 6.6 struck off the coast of El Salvador on Thursday, 40 km south of La Libertad, the U.S. Geological Survey said.