Kim Dotcom, the founder of the Megaupload online file-sharing site.

Auckland - Internet mogul Kim Dotcom avoided returning to jail in New Zealand on Monday when an Auckland court rejected a US application to revoke bail granted as part of a marathon online piracy case.

Dotcom said the failed bid to lock him up was based on “bogus” allegations that he had breached bail conditions set following his arrest in a dramatic police helicopter raid on his home in 2012.

“I think this is another example of harassment and bullying by the United States government in concert with the New Zealand government,” he told reporters outside the Auckland District Court.

Dotcom spent a month in jail after his arrest in January 2012, when an FBI-led investigation shut down his Megaupload file-sharing empire, alleging it pocketed more than US$175-million from pirating movies and other copyright material.

He was granted bail ahead of a US bid to extradite him on racketeering and money laundering charges carrying potential jail terms of 20 years.

The extradition is scheduled for June next year, and lawyers for the US government alleged Dotcom had breached his bail conditions and should be in custody until the hearing takes place.

Dotcom, who denies the online piracy charges, said the court found he had done nothing wrong.

“I have been probably the most compliant and exemplary candidate of bail in New Zealand,” the German-born businessman said.

Dotcom said last week that he had already spent US$10-million defending the case and was broke because all of his Megaupload assets had been frozen.

He has started a successful new online venture, Mega, which has reportedly generated earnings of US$40-million, but its shares are held in trust by his children and estranged wife. - AFP