A strong and shallow earthquake has hit off the coast of Indonesia's Sumatra island, killing seven people and injuring 85, and causing panic on the island and in neighbouring Malaysia and Singapore.

The magnitude 6.2 earthquake struck about 41 miles north-north-west of Bukittinggi, a hilly town in West Sumatra province, according to the US Geological Survey. It occurred about 7.4 miles below the Earth's surface.

At least four people, including two children, were killed in Pasaman district and three people died in the neighbouring district of West Pasaman, which is near the epicentre where dozens of houses and buildings reportedly collapsed, said Abdul Muhari, the National Disaster Mitigation Agency's spokesman.

The earthquake sent more than 5,000 people fleeing their homes to temporary shelters mostly in the devastated areas of Pasaman and West Pasaman districts, Mr Muhari said.

"We are still focusing on search and rescue efforts for the victims," he added.

Authorities were investigating the full extent of the damage in the affected areas.

Dwikorita Karnawati, head of Indonesia's Meteorology, Climatology and Geophysical Agency, said there was no danger of a tsunami but warned of possible aftershocks.

Television reports showed the strong tremor sending panicked people into the streets in Padang, the capital of West Sumatra province, and patients in a hospital in West Pasaman being evacuated from the building.

Other footage showed streams filled with mud from landslides triggered by the earthquake, and a mosque, a school and several houses that were flattened.

Nearly 500 houses and buildings were reportedly damaged, 100 seriously, Mr Muhari told MetroTV.

People in neighbouring Malaysia and Singapore also reportedly felt the tremors.

A video on social media showed residents gathered in streets after high-rise buildings in Kuala Lumpur swayed for a few seconds.

Witnesses reported seeing their doors and chairs shaking, and photos and paintings trembling on the walls.

Indonesia, a vast archipelago of more than 270 million people, is frequently struck by earthquakes, volcanic eruptions and tsunamis because of its location in the so-called Ring of Fire, an arc of volcanoes and fault lines in the Pacific Basin.

In January 2021, a magnitude 6.2 earthquake killed at least 105 people and injured nearly 6,500 in West Sulawesi province.

A powerful Indian Ocean quake and tsunami in 2004 killed nearly 230,000 people in a dozen countries, most of them in Indonesia.