The quake caused residents to flee buildings in some areas and triggered evacuations nearly 400km (250 miles) away in Malaysia.

"We continue to monitor and advise people to remain on alert," Dwikorita Karnawati, the head of Indonesia's geophysics agency BMKG, told MetroTV. The agency initially put the magnitude at 6.2.

The disaster mitigation agency said seven were killed and 85 were injured. Its chief said some buildings, including a government office, homes and a bank sustained damage.

A hospital was evacuated in West Pasaman, about 17 km (10.6 miles) from the epicentre, while a witness said residents in other areas panicked as the earthquake shook buildings for over a minute, rattling glass windows and furniture.

"People gathered outside their homes and workplaces. They were scared of the tremors. Cables were shaking," said Frans Kiky Nainggolan, a shopkeeper living in Riau province on Sumatra.

Authorities in the Malaysian capital Kuala Lumpur received calls about tremors felt in the city, though there had been no reports of injuries or damage.

"I felt the tremors for one to two minutes...We evacuated fast and others from another floor also," said Hilfa Akmal, who lives on the outskirts of Kuala Lumpur.

Singapore police said on Twitter they had also received calls from people reporting tremors, though there were no reports of injuries.

Indonesia suffers frequent earthquakes, straddling the so-called "Pacific Ring of Fire", a seismically active zone where different plates of the earth's crust meet.

The fault along Sumatra island can be particularly active and dangerous. In 2004, a massive 9.1 magnitude quake and a tsunami off the northern tip of Sumatra killed 226,000 people in Indonesia, Sri Lanka, India, Thailand and nine other countries.

(Reporting by Angie Teo, Fransiska Nangoy, Stanley Widianto, Bernadette Christina; Additional reporting by Rozanna Latiff in Kuala Lumpur and Aradhana Aravindan in Singapore; Editing by Ed Davies and Kanupriya Kapoor)