There were no immediate reports of injuries or damage.
The US Geological Survey said the quake struck at 3:33 pm local time, had a depth of about 10 kilometres and was centred about 113 kilometres northeast of Quito.
The tremor was felt in small towns on both sides of the border.
Officials in the Colombian town of Cumbal, near the quake's epicentre, said they formed an emergency committee to survey possible damage. But so far, there were no reports of injuries in the town of 36,000 residents, the majority of them members of an indigenous tribe.