Megaupload's flamboyant founder Kim Dotcom will stay free on bail after a New Zealand judge dismissed an appeal on Wednesday that sought to return him to jail.

Megaupload's flamboyant founder Kim Dotcom will stay free on bail after a New Zealand judge dismissed an appeal on Wednesday that sought to return him to jail.

Dotcom, who ran the Megaupload file-sharing website until it was shut down, was denied bail shortly after he was arrested on Jan. 20. The decision was upheld after he appealed.

Dotcom then filed a second bail application based on new factual circumstances and was freed on Feb. 22. The judge found it was unlikely that Dotcom would flee New Zealand since it appeared all of his bank accounts have been frozen.

But New Zealand prosecutors acting on behalf of the U.S. government appealed, arguing he is still a flight risk. They lost that appeal with Wednesday's ruling.

Dotcom holds German and Finnish passports but could be prosecuted in either of those nations if he fled. As part of his bail conditions, Dotcom is required to mostly stay at his rented mansion outside of Auckland except for medical emergencies, wear an electronic monitoring bracelet, and stay off the Internet. His wife, who is pregnant with twins, and their three children also remain at the mansion.

The U.S. is expected to soon request Dotcom's extradition to face charges of copyright infringement, racketeering, money laundering and wire fraud. A grand jury in U.S. District Court for the Eastern District of Virginia indicted Dotcom along with six other Megaupload associates and two companies on Jan. 5.

The U.S. Department of Justice alleges Megaupload ran a criminal organization that sold subscriptions to its website offering fast downloads of content such as movies, TV programs, e-books, music, video games and computer software without permission from copyright holders.

Dotcom's extradition hearing isn't expected to begin until July at the earliest.