Ecuador's Geophysical Institute said the quake occurred at 01:26 am local time at a depth of 12 kilometres off the Ecuadorian coast.
The quake was felt in the capital Quito and the coastal city Esmeraldas near Colombia.
Despite the seismic event's strength, authorities said there was no immediate sign of damage.