Five people died and at least seven were injured in yesterday's massive earthquakes off Indonesia's Sumatra island.

Officials said they believed at least two people died of heart attacks and three others died of shock in the quakes on Wednesday.

"Based on data collected on victims and damage, five people died, one person is critically injured and six others had minor injuries," National Mitigation Agency spokesman Sutopo Purwo Nugroho said.

An 8.6-magnitude quake struck 431km off the city of Banda Aceh late yesterday afternoon.

It was followed by another undersea earthquake measured at 8.2, with aftershocks continuing through the night.

All of the casualties were in Aceh province, Mr Nugroho said.

Communities in Aceh have now returned to daily life, Nugroho added, in stark contrast to the devastation caused by the massive 2004 Indian Ocean tsunami that killed 170,000 people in the province alone and wiped out entire towns.