A shallow 5.1-magnitude earthquake has stuck the Ecuadoran capital Quito, triggering landslides and killing at least two people.

Another eight people were injured and three others trapped in the landslides at quarries on the outskirts of Quito, the country's risk management agency said on Twitter.

A landslide also engulfed a vehicle on a road north of the city, but the driver escaped unharmed, rescue workers said.

Authorities closed roads around the capital in case of more landslides, and also shut the Quito airport.

The quake lasted more than 20 seconds and caused panic in Quito, where residents evacuated buildings after it struck at 2.58pm (1958GMT).

"I was talking on the phone with my daughter and suddenly the line went dead. I thought the house was falling down," Laura Flores, a resident of Quito's northern Carcelen district said. 

She said the quake had opened a crack in one wall of her house and caused several plates to fall and break.

The country's Geophysics Institute said the quake ocurred at a depth of 5km and was followed by a forceful aftershock.

It warned that more small aftershocks were possible.

Emergency services said the epicenter was near Mitad del Mundo, a tourist attraction at the equator where a monument is being built at the dividing line between the northern and southern hemispheres.

Ecuador is located along the Pacific Ocean's seismically turbulent "Ring of Fire," which makes it prone to earthquakes.