Malaysian authorities have detained four tourists - two Canadians, a Briton and one Dutch national - for allegedly stripping naked on Mount Kinabalu, an act some locals say angered tribal spirits and caused a deadly earthquake, officials said.

Pictures of 10 naked tourists had spread on social media and infuriated locals following the 6.0-magnitude quake that struck near the mountain on Friday and killed 18 people. Six other tourists are still apparently at large, according to police.

Mount Kinabalu, a UNESCO World Heritage Site and popular climbing destination, is considered sacred by Malaysia's Kadazan Dusun tribal group, who believe it is a resting place for spirits.

"We detained all four of them on Tuesday ... and yes we are still searching for the other six tourists, and we will catch them," said Jalaluddin Abdul Rahman, the police commissioner for the Malaysian State of Sabah where the mountain is located.