According to the US Geographical Survey, the quake's epicentre was 36 miles south of the city of Esmeraldas, at a depth of 6.2 miles.
A destructive Pacific-wide tsunami was not expected, the Pacific Tsunami Warning Center said in a statement.
There was no report of significant damage, but electricity was cut in some coastal areas. However, people ran into the streets as far away as the highland capital Quito, according to witnesses, suggesting fears over earthquakes remain strong.
Ecuador earthquake in pictures
Show all 16
President Rafael Correa said the epicenter was the fishing village of Mompiche on the Pacific coast, and only some "small damages" had been caused.
"All quiet," he tweeted. "[People from] Quito can return to their homes."
A national emergency committee had been convened but is due to be deactivated, the president said.
In April, a 7.8 magnitude earthquake hit the country in one of Ecuador's worst disasters for nearly seven decades. It killed more than 650 people and injured around 16,600.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies