On Thursday, the men — one of whom, Jack Walker, is an aide to a senior Australian cabinet minister — each pleaded guilty to creating a public nuisance and apologized, said one of their lawyers, Wan Aizuddin. A judge then dismissed the charges and released them with a warning.

“We had no idea that our conduct would be deemed to be inappropriate, crass or even downright offensive to the citizens of this country,” the defendants said in a statement read outside the courtroom by another defense lawyer, Muhammad Shafee Abdullah, after the hearing.

A Malaysian police official had said earlier that the men would be investigated on suspicion of intentional insult with intent to provoke a breach of the peace, a charge that carries a maximum sentence of two years. The public nuisance charge to which the men pleaded guilty is punishable by a fine of $96, but no jail time, Mr. Aizuddin said.

“They all have good jobs in Australia and come from good families,” Mr. Aizuddin said by telephone after the hearing. “These were mitigating factors. They are young fellows. They never meant to cause offense.”