JAKARTA:  A video of an Indonesian imam stoically reciting evening prayers in Bali as a deadly earthquake struck neighbouring Lombok has gone viral on social media, with internet users praising him for his unwavering faith.

The white-robed Islamic leader was preaching on Sunday night at a mosque in Denpasar on the holiday island of Bali when the shallow 6.9-magnitude earthquake struck.

Footage of the imam, recorded on a cellphone, showed him supporting himself against the wall as the room shook violently around him and as some congregants fled the building.

Other worshippers can be seen stoically remaining in prayer as the mosque rocked from side to side.

The powerful quake killed at least 91 people and damaged thousands of buildings in Lombok. A number of mosques on that island have collapsed with worshippers inside them.

It was also felt strongly in the neighbouring Bali, a predominantly Hindu island in the world's largest Muslim majority nation.

The clip quickly went viral after the mosque posted it to Facebook.

It has been watched more than 130,000 times on Facebook and shared on Youtube and Twitter.

"I am crying... he did not even flinch, even though it is allowed to leave your prayer during an earthquake," said Indonesian cleric Yusuf Mansur, who shared the clip to his two millions followers on Instagram.

"The faith shown by the Imam and the worshippers is extraordinary," a Twitter user Inyol tweeted to his 39,000 followers.