A 6.2 magnitude earthquake struck 27 kilometers (17 miles) north of the city of Santa Elena on the coast of Ecuador on Sunday, the U.S. Geological Survey (USGS) said.