Briton Eleanor Hawkins, Canadians Lindsey and Danielle Peterson, and Dutchman Dylan Snel admitted causing a public disturbance.
The group was blamed for a magnitude 5.9 earthquake after stripping on Mount Kinabalu, which is considered sacred.
They were jailed for three days, but their sentences were back-dated to reflect time already served.
A judge at Kota Kinabalu Magistrates’ Court said the four had shown remorse and ordered the jail terms to run from 9 June, meaning the group is free to leave.
He also fined each defendant 5,000 Malaysian ringgit (£860/$1,330).
The tourists were escorted to the court house by masked men and then mobbed by members of the press
The BBC’s Jennifer Pak, who was in court, said she understood the group were now waiting to pay their fines before being deported.
Hawkins’ lawyer Ronny Cham said the 23-year-old, from Draycott in Derbyshire, would be freed from police custody later on Friday and her release documentation was being arranged.
She would then fly home to the UK on Saturday, her lawyer said.
Her father Timothy Hawkins said the sentence was “appropriate and fair” but it appeared she had been “treated pretty badly” amid the media scrum outside court.
“She’s obviously very traumatised,” he said.
“Eleanor knows what she did was wrong and disrespectful and she is deeply sorry for any offence she has caused to the Malaysian people.”
What do the Malaysian papers say?
Foreign coverage of the story has been criticised in the Malaysian press.
Several local newspapers accused British tabloids of exaggerating reports that the tourists were arrested for causing the quake, rather than the actual charge of public indecency.
The Sabah-based Daily Express accused the papers of running “sensational” headlines, while the country’s most popular English-language paper, The Star, said reports (pictured) alleging Hawkins and the others were arrested for angering mountain gods “couldn’t be further from the truth”.
Tourism minister, Masidi Manjun, said their acts would have merited punishment for breaking local laws and norms whether or not the earthquake took place.
Mr Masidi, who comes from the foothills of Mount Kinabalu, was also quoted in the Malay Mail as saying there had been some “fact-twisting” by foreign media.
“I don’t know whether this is on purpose just to ridicule us, or their failure to appreciate our local traditions and customs,” he said.
Eleanor Hawkins and her co-accused covered their faces as they arrived at Kota Kinabalu Magistrates’ Court
Eleanor Hawkins had previously admitted the stunt was “stupid and disrespectful”
Speaking to reporters outside his home, Mr Hawkins said the family were looking forward to his daughter’s return.
“We do not know when this will be as we’ve had no contact from the High Consulate in Malaysia, and we’ve not spoken to Ellie,” he said.
She and her co-accused all admitted a charge of “committing an obscene act in public”.
Prosecutors said the four tourists, along with six others, climbed the peak to enjoy the sunrise on 30 May and then challenged each other to take off their clothes.
But the court amended the facts to agree the accused did not tell the guide to “shut up” or “go to hell”, as the prosecution had alleged.
Dutch national Dylan Thomas Snel, 23, and Canadian siblings Lindsey, 23, and Danielle Peterson, 22, have all pleaded guilty
Their lawyer said they had simply ignored pleas not to remove their clothes, and had not verbally abused the guide.
Mr Cham, who representing all four defendants, said they were ignorant of local customs and “their act had brought shame and ridicule upon themselves and their respective countries”.
He asked the judge to not make an example of them, saying the intense international media coverage had traumatised them enough.
The prosecution argued the public interest was central to the case and, according to Malaysian law, anyone committing an “obscene act” which causes annoyance in a public place should be jailed for up to three months.
Many Malaysians had been outraged by the group’s behaviour, he said, and the case was about “upholding the [country’s] morals and customs”.
Images of the group at the top of Mount Kinabalu were posted on social media
Earlier, the four arrived at court accompanied by officials wearing balaclavas.
The accused covered their faces as they entered the building, surrounded by a media scrum.
“There’s a lot of public anger still against the tourists because many of them believe Mount Kinabalu is a sacred spot where their souls go to rest when they die,” Ms Pak said.
“The fact that these foreigners are alleged to have stripped on the peak, urinated and cursed at staff members trying to stop them is something that many locals say is disrespectful.”
Last Friday, an earthquake struck killing 18 people, including children, and leaving hundreds more stranded.
Sabah state deputy chief minister Joseph Pairin Kitingan blamed it on the travellers showing “disrespect to the sacred mountain“.
News agency AFP said police were still seeking five other suspects but some were thought to have already left Sabah.
Why is Kinabalu considered sacred?
- Sabah’s Kadazan Dusun tribe believe the mountain houses the spirits of their dead ancestors
- The name Kinabalu is derived from the tribe’s phrase “Aki Nabalu”, which means resting place of the dead
- Climbers are told by guides, many of whom are Kadazan Dusun, to treat the mountain with respect and to refrain from shouting, screaming or cursing at it
- Every December the tribe conducts a ritual called the Monolob to appease the spirits and allow climbers to continue visiting the mountain
- A priestess, called a Bobolian, makes an offering of seven white chickens accompanied by seven chicken eggs, betel nuts, tobacco, limestone powder, and betel plant leaves. The Bobolian leads a chant and the chickens are then slaughtered, cooked, and given to the ceremony participants
- In the past, this ceremony was conducted before every ascent, and climbers used the cooked meat as rations for their journey