Media playback is unsupported on your device Media caption Stripping came "quite naturally" to the boys, according to their lawyer

Nine Australians arrested for stripping off at the Malaysian Formula One Grand Prix have walked free from a court.

The group, branded the "Budgie Nine", were charged with public nuisance, which carries a fine but no jail time.

The men were detained after posing in swimwear decorated with the Malaysian flag to celebrate Australian Daniel Ricciardo's win in Sunday's race.

In a letter read out in court, they apologised and expressed their "deepest regret".

They said the incident was "purely an error of judgement" on their behalf.

Image copyright Getty Images Image caption The men have spent four days in detention in Malaysia

Image copyright Getty Images Image caption The men were discharged by the judge on account of being "young, remorseful and ignorant

Budgie is the abbreviated name of the budgerigar, a small Australian parrot, and budgie-smuggler is a slang term for tight swimming trunks worn by men.

Among the men was Jack Walker, an aide to Australian Defence Industry Minister Christopher Pyne.

His father John Walker addressed the media outside the court after the hearing, saying that his son and the other eight were "good boys".

One of the men, Thomas Whitworth, fainted during the proceedings and had to be given water.

'Briefs won't be made again'

Many Australians took to social media to express anger and embarrassment at the men's antics, while others saw their actions as nothing more than foolish hijinks.

Image copyright Twitter

Earlier, Australian Foreign Minister Julie Bishop told the Nine Network that what may be seen as a foolish prank in Australia could be viewed very differently in other countries.

"I don't know that it will be seen as a lapse of judgment," she said. "It was clearly premeditated. They were wearing the budgie smugglers and had bought them in Australia."

Malaysia has strict rules on any display of public indecency and foreign offenders are typically issued a fine before being deported.

Last year four foreign tourists were jailed for taking naked photographs at the peak of Mount Kinabalu in Malaysia.

The maximum fine for public nuisance is RM400 (£76; $96). It was not immediately clear what the men will have to pay.

Their lawyer, Shafie Abdullah, had argued that his clients were part-time lifeguards, so stripping down came quite naturally to them.

A spokesperson from Budgy Smuggler, the swimwear company behind the swimwear, said it would not produce the Malaysian flag design again.

"We've produced for about 50 countries around the world and this is the first time it's caused an international incident," Jarrod Allen, head of research and development, told the BBC.

"We'd never set out to intentionally disrespect."