"They were remorseful and regretted their act, and had offered a public apology during mitigation," said lawyer Ronny Cham.
The four were among 10 foreigners who stripped naked and took photos on Mount Kinabalu on May 30.
A local official has said their behaviour was disrespectful to the mountain, which is believed to be sacred, and caused an earthquake on June 5 that killed 18 climbers.
The two Canadians were Saskatchewan siblings Lindsey Petersen and Danielle Petersen. The other two westerners were Dutch citizen Dylan Snel and British student Eleanor Hawkins.
The four pleaded guilty in a court in Sabah state on Borneo island to a charge of public indecency, said Cham.
The court was told the women were topless while the two men were totally nude, he said.
The court sentenced them to three days in jail and a fine of the equivalent of more than $1,600 Canadian each, to be followed by their deportation, Cham said.
They have paid their fines and expected to be released later Friday because of the time they have already spent in jail since their arrests earlier this week, he said.
Some reports said they were freed immediately.
Hawkins was scheduled to fly home Saturday, but the lawyer couldn't say when the others would leave.
The Malay Mail online news portal said the court was told the group of 10 had challenged each other to see who could remain naked the longest in the cold.
They ignored a plea by their mountain guide not to strip, it said.
Cham said the four had suffered enough trauma and that extensive international news coverage would deter others.
The Guardian newspaper reported Danielle Peterson arrived in court handcuffed to Hawkins while Lindsey Peterson arrived handcuffed to Snel.
Prosecutor Jamil Aripin agreed that there was no link between the earthquake and their act but said it had outraged the local community, The Malay Mail online news portal said.
The magnitude-5.9 earthquake sent rocks and boulders raining down on trekking routes on the 4,095-meter mountain. The victims were nine Singaporeans, six Malaysians, a Filipino, a Chinese and a Japanese.
The quake damaged roads and buildings and also broke one of the famous twin rock formations on the mountain known as the "Donkey's Ears."
Sabah Deputy Chief Minister Joseph Pairin Kitingan blamed the tragedy on the foreigners for having shown disrespect to the mountain, believed by local tribes to be a resting place for the dead. He said a special ritual will be conducted to appease the mountain spirits.
The incident became an international talking point, including a Twitter exchange between the head of the tourism department for the state of Sabah and Emil Kaminski, a man who posted video and photos about the issue.
Kaminski — whose comments were widely reported, including by The Canadian Press — said in a later video that he wasn't part of the group and wasn't in Malaysia at the time.
--With Files From The Canadian Press
Also on HuffPost