HONG KONG — Four Western trekkers who were accused of taking nude photographs on Malaysia’s highest peak were ordered detained on Wednesday pending an investigation into public obscenity charges, their lawyer said.

Some local officials have been quoted as saying that the tourists’ behavior last month on Mount Kinabalu, which many in the area consider sacred, may have caused an earthquake on Friday that left 18 people on the mountain dead.

The Western tourists — a Canadian brother and sister, a British woman and a Dutch man, who range in age from 22 to 24 — were ordered held for four days while an investigation is conducted, according to their lawyer, Ronny Cham. They could face jail terms of up to three months, Mr. Cham said.

The four were part of a group of 10 trekkers who, after breaking away from a larger group, began to disrobe and take photographs, news reports said. Malay Mail Online reported that they insulted a guide who tried to stop them.