The quake was so powerful that frightened residents in Mexico City more than 1,000 km away fled apartment buildings, some in their pajamas, and gathered in groups in the street.

An earthquake of magnitude 8.1 struck the southern coast of Mexico late on Thursday, the U.S. Geological Survey (USGS) said, killing at least five people, triggering small tsunami waves and damaging some buildings.

The quake was apparently stronger than a devastating 1985 tremor that flattened swathes of Mexico City and killed thousands, but initial reports of damage in the city were limited.

The epicentre was 87 km southwest of the town of Pijijiapan in the southern state of Chiapas, at a depth of 43 miles. Three people were killed in the state, said Governor Manuel Velasquez. Two more people were killed in neighbouring Tabasco state, the state governor said.

Also Read Major earthquakes of the past 30 years

The quake triggered waves as high as 2.3 ft (0.7 m) in Mexico, the Pacific Tsunami Warning Centre said. It said widespread, hazardous tsunami waves were possible within three hours. However, there was no tsunami threat for American Samoa and Hawaii, according to the U.S. Tsunami Warning System

As far as 14,000 km (8700 miles) away in the Philippines, the national disaster agency put the countrys entire eastern seaboard on alert. No forced evacuation was ordered, but residents were told to monitor emergency radio broadcasts.

In Mexico, some buildings were severely damaged in the south of the country, including a hotel where rescuers were searching to make sure nobody was trapped.

Windows were broken at Mexico City airport and power went out in several neighbourhoods of the capital. The cornice of a hotel collapsed in the southern tourist city of Oaxaca, a witness said.

People in the capital, one of the world's largest cities, ran out into the streets in pyjamas and alarms sounded after the quake struck just before midnight, a Reuters witness said.

Helicopters hovered overhead a few minutes later, apparently looking for damage to buildings in the city, which is built on a spongy, drained lake bed.

In one central neighbourhood, dozens of people stood outside after the quake, some wrapped in blankets against the cool night air. Children were crying.

Liliana Villa (35), was in her apartment when the earthquake struck and she fled to the street in her pyjamas.

“It felt horrible, and I thought, 'this is going to fall'.”

USGS reported multiple aftershocks, ranging in magnitude from 4.3 to 5.7.

State oil company Pemex said it was still checking for damage at its installations but has no immediate reports of problems, including at the Salina Cruz refinery, which is in the same region as the epicentre.

“I had never been anywhere where the earth moved so much. At first I laughed, but when the lights went out I didn't know what to do,” said Luis Carlos Briceno, an architect (31), who was visiting Mexico City. “I nearly fell over.”