The founder of online file-sharing website Megaupload, accused of masterminding a scheme that allegedly made more than $175 million through Internet piracy and illegal file sharing, was ordered held in custody by a New Zealand court on Wednesday.

Kim Dotcom, a German national, also known as Kim Schmitz, was remanded in custody until Feb 22 ahead of a hearing of the extradition application by the United States government, which also alleges racketeering and money laundering.

Dotcom, 38, and three others, were arrested on Friday after New Zealand police raided his country estate at the request of the U.S. Federal Bureau of Investigation. Police cut Dotcom out of a safe room he had barricaded himself in within the mansion, reputedly New Zealand's most expensive home.

The judge said there was a significant risk Dotcom, who had passports in three names, could make an attempt to flee the country.

With sufficient determination and financial resources flight risk remains a real and significant possibility which I cannot discount and bail is declined, Judge David McNaughton said in a written decision.

Dotcom, dressed in the same black trousers and track suit top he was arrested in on Friday, showed no emotion when the decision was read out, but his lawyer said he was very disappointed and would appeal immediately.

The judge has agreed with much of what we have submitted but he has taken a different view on the issue of flight risk, Paul Davison told reporters.

The judge said the finding of unlicensed and illegal guns in the luxury mansion raided by police on Friday pointed to possible criminal connections, which could make it easier to escape to Germany, where Dotcom would be safe from extradition.

U.S. authorities want to extradite Dotcom on the charges, although his lawyer has said the company simply offered online storage, and that his client is innocent.

He had argued for bail saying that he posed no threat of absconding or restarting his businesses. But the prosecutor said he was a flight risk at the extreme end of the scale because it was believed he had access to funds, had multiple identities, and had a history of fleeing criminal charges.

The judge said he could not assess whether the U.S. had a strong enough case against Dotcom or whether he had a good defense.

All I can says is that there appears to be an arguable defense at least in respect of the breach of copyright charges, McNaughton wrote.

An extradition application must be lodged within 45 days of Dotcom's arrest, and the U.S. government will have to show that the alleged offences would be crimes in New Zealand punishable by a jail term of at least 12 months.

The prosecution has said an extradition hearing might take only a day because the evidence will be given in summary form, but McNaughton said he did not know how long a hearing would take, nor could it be heard for some months.

A group of Dotcom's supporters left the court dejected and refused to talk to media.

Three other men charged with Dotcom were also remanded, but their lawyers immediately applied to the judge for separate hearings to make individual bail applications.

(Reporting by Michael Perry; Writing by Gyles Beckford; Editing by Ed Davies and Lincoln Feast)