In Indonesia's tsunami wastelands on the northern tip of Sumatra island, little remains of whole towns lost to the colossal forces that came thundering in from the ocean.

But across these battered shores, dozens of mosques still stand, their minarets glinting defiantly in the sun - a phenomenon survivors in the deeply Islamic region credit as much to divine intervention as robust architecture.

"God's invisible hands prevents the mosque's destruction," said Mukhlis Khaeran, who saw the sea sweep away his home village of Baet outside the north Sumatran city of Banda Aceh, but leave the neighbourhood mosque relatively intact.

"He punishes us for our greed and arrogance but He will protect his house," Khaeran said, his arms covered with injuries sustained in the disaster that killed at least 100,000 people around the north Sumatran province of Aceh.

Mosques are an everyday sight in most of Indonesia, but especially in Aceh, credited with the being one of Islam's main gateways into the archipelago of islands which now forms the world's largest Muslim-populated country.

Despite a long-lasting independence struggle, Aceh, parts of which are under traditional Islamic sharia law, has remained a Muslim heartland for Indonesia, which mostly practices a very relaxed interpretation of the faith.

Spiritual beliefs in Aceh and around the Indian Ocean were tested to the limit on December 26 when an epic earthquake sent towers of water crashing ashore, obliterating virtually everything in their path.

But while some spoke of "God's wrath", hundreds turned to their mosques, in panic for shelter from the advancing tides and later for spiritual comfort in a time of desperate need.

In the village of Kaju, also outside Banda Aceh, hundreds of homes were annihilated while the local mosque suffered only a few cracks in the walls.

"There is a saying among Acehnese that a mosque is God's house and no one can destroy it but God Himself," said Ismail Ishak, 42, who was digging rubble from his crumbled house while searching for seven of his relatives.

In Pasi Lhok, some 20 kilometres (12 miles) east of the north Aceh town of Sigli, 100 frightened people sheltering inside their mosque were spared while almost every house in the surrounding five villages was pulverised, according to chief cleric Teungku Kaoy Ali.

In Meubolah, a town on Aceh's western coast less than 150 kilometres (95 miles) from the quake epicentre which bore the full force of the tsunami, leaving at least 10,000 dead, mosques stand sentinel over a vanished town centre.

Banda Aceh resident Achyar said when he saw the waves pounding in from the sea, his first instinct was to turn and run for the nearest mosque.

"I climbed the mosque tower and hung on to an electric wire until water receded," he said. "Many of my friends, many of them ethnic Chinese, died because they climbed to the second floor of their shops and were trapped there," he said.

Another, less divine, explanation for the survival of the mosques is that many are built much more sturdily than most of the other structures in the towns and cities of Aceh.

However one mosque in Sigli was made only of wood but still survived unscathed despite all the other buildings around it being destroyed.

Banda Aceh's grand Baiturrahman mosque suffered partial damage from the quake and tsunami, but proved invaluable to the city's survivors in the minutes, hours and days that followed the cataclysm.

For many it became a rallying place to search for missing friends or relatives, a makeshift hospital to treat the injured and a morgue to collect the dead.

With much of Banda Aceh likely to remain in ruins for months, residents were quick to repay their debt to their cherished religious buildings, working swiftly to ensure the Baiturrahman mosque was one of the first places restored.

On Sunday, some 300 survivors gathered for their first prayers since their five-times daily ritual was halted - a major step on the long road back to normality in Aceh.