Thousands of Indonesians prayed for their loved ones at mass graves and mosques Monday to mark a tsunami which devastated Aceh province 12 years ago today, one of the worst natural disasters in human history.

Some 170,000 lives were lost in the country when a 9.1-magnitude "megathrust" quake struck Aceh, a predominantly Muslim province in the northern tip of Sumatra island, bringing about massive waves that also hit coastal areas as far away as Somalia.

"I came here every year to pray for my children, daughter-in-law, and their three children," Maryam, who goes by one name, told AFP, at the Ulee Lheue mass grave, where 14,800 people were buried.

The bodies of her family were never found but 65-year-old Maryam, who survived by holding on to a tree trunk, was certain her family were buried in the mass grave as they lived in the vicinity at the time of the tsunami.

Graves across the province, including in Siron in Aceh Besar district where more than 46,000 were buried, were crowded with people who scattered flowers on the earth where they believe the remains of their loved ones lie to rest.

Survivors then gathered at a mass prayer in Ulee Lheue mosque, one of the few sea-front mosques still standing in the region after the tsunami.

"The main reason to commemorate the earthquake and tsunami disaster was not to open old wounds," acting Aceh governor Soedarmo told the mosque attendance.

Indonesia sits on the Pacific "Ring of Fire", where the meeting of continental plates causes strong seismic activity, and is frequently hit by earthquakes.

The tsunami commemoration comes just weeks after a strong 6.5-magnitude shallow quake struck inland in Pidie Jaya, a district in Aceh, killing more than 100 people, levelling hundreds of buildings and displacing nearly 84,000 people.