The backpackers -- from Britain, Canada and the Netherlands -- were arrested after stripping naked May 30 and posing for photos on the mountaintop, the nation's
Bernama news agency reported. The mountain is considered sacred in Malaysia.
CNN has verified the identity of the two Canadians as Lindsey and Danielle Peterson. The Briton is named Eleanor Hawkins. The name of the Dutchman has not yet been confirmed by CNN.
The court in Kota Kinabalu on Friday evening fined the four 5,000 Malaysian ringgits, about $1,332, each and sentenced them to three days in prison. Taking into account the time served already, the court ordered them freed.
Local residents had said their behavior caused the Kota Kinabalu earthquake this month, which killed 16 people. The indigenous people of Sabah believe the tourists disrespected local culture and angered the spirit of the mountain, Bernama reported.
Among those who appeared in court was a British citizen who was arrested at the airport this week as she was about to leave for the capital of Kuala Lumpur.
The other three turned themselves in. They could have faced three months in prison.
It is not the first time tourists have made headlines for stripping off their clothes at major attractions.
Cambodia deported two U.S. tourists for allegedly taking nude pictures at Angkor Archaeological Park after a string of nudity-related incidents
hit the religious sites this year.
At least eight tourists were detained
last year in separate incidents for getting naked and posing for photos in Machu Picchu, the 15th-century attraction in Peru.