Soldiers have pulled a man alive from the rubble of a large mosque flattened by an earthquake on the Indonesian island of Lombok.

Thousands of homeless locals waited for aid on Tuesday and stranded tourists camped at beaches and in the lobbies of damaged hotels.

The north of Lombok has been devastated by the magnitude 7.0 quake that struck on Sunday night, damaging thousands of buildings and killing at least 98 people.

Rescuers were still struggling to reach all of the affected areas and authorities expect the death toll to rise.

Indonesia EarthquakeA man is carried by Indonesian military personnel after they rescued him from a collapsed mosque (Ivan Fadillah/AP)

Disaster officials have not said how many people they believe are buried beneath the ruins of the Jabal Nur mosque but a rescue worker said about 50 people were praying inside when it collapsed.

Video shot by a soldier shows rescuers shouting “Thank God” as a man is pulled from a space under the mosque’s flattened roof sometime on Monday and he staggers away from the ruins supported by soldiers.

“You’re safe, mister,” says one of the soldiers as emotion overcomes the man, clad in Islamic robes, and villagers crowd around him.

Disaster agency spokesman Sutopo Purwo Nugroho said he hopes “a lot” of people can be saved from the mosque.

Two people were rescued from the building on Monday including a woman with a broken leg, said villager Supri Yono, and three were found dead.

“We’re forced to deal with broken bones in the traditional way at home because the hospital had to deal with hundreds of other injuries,” said Budhiawan, the head of Lading-Lading village.

Rescuers were using heavy duty cutting equipment on Tuesday to prize apart the tangled mound of debris.

Aid organisations, already on Lombok after it was hit a week earlier by a 6.4 quake that killed 16 people, said they were stepping up their humanitarian efforts.

Indonesia EarthquakeA motorist rides past a house heavily damaged by the earthquake (Tatan Syuflana/AP)

Oxfam said more than 20,000 people were in temporary shelters and thousands more were camping out in the open.

It said clean drinking water was scarce because of a recent spell of extremely dry weather in Lombok.

Hundreds of tourists and workers were still struggling to get off three outlying resort islands where power was cut off and hotels and hostels were damaged.

British tourist Saffron Amis, stranded on Gili Trawangan island, said she spent a second night outdoors as aftershocks rattled the region.

Indonesia EarthquakeRescue teams search for victims in the rubble at a mosque (Tatan Syuflana/AP)

“We slept in a bungalow until another quake hit us at midnight and then we moved to the beach,” she said.

At Lombok’s airport, dozens of tourists slept on the floor as they waited for flights off the island.

Many hotels closed because of damage but some allowed travellers to camp in their lobbies.

“That was my first experience with the earthquake and it was really terrible,” said Lize Reert, a Belgian woman among the several thousand who fled Gili Trawangan.

“It was a nightmare.”