A New Zealand judge on Monday upheld an earlier court ruling that flamboyant internet entrepreneur Kim Dotcom and three of his colleagues can be extradited to the U.S. to face criminal charges.

The decision comes five years after U.S. authorities shut down Dotcom's file-sharing website Megaupload and filed charges of conspiracy, racketeering and money laundering against the men. If found guilty, they could face decades in prison.

Dotcom, who lives in New Zealand, has been fighting extradition in a case which has moved with glacial slowness at times. And Monday's decision won't be the last, with the case likely to be appealed up to New Zealand's Supreme Court, a process that could take another year or two.

U.S. prosecutors say that Megaupload raked in at least $175 million, mainly from people using it to illegally download songs, television shows and movies.

The New Zealand district court ruled in 2015 that Dotcom and the others were eligible for extradition on the charges.

High Court judge Justice Murray Gilbert found Monday that the district court made mistakes in its ruling but that those didn't alter the big picture.

Dotcom tweeted Monday: "We won but we lost anyway."

Dotcom's lawyer Ron Mansfield said the high court agreed with a major part of their appeal — that copyright infringement on its own isn't an offense that warrants extradition — but had erred in finding the men could be extradited on conspiracy grounds.

"Look, we're disappointed it's not all over in the high court," Mansfield said. "But we're one step away, as far as we're concerned, from winning outright."

Mansfield said they are determined to keep fighting. "There are substantial legal issues in play," he said.

The U.S. argues that the site cost copyright holders, which included Hollywood's major movie studios, more than $500 million. Prosecutors say intercepted communications show the men talking about being "modern-day pirates" and "evil" and that they were part of a conspiracy to profit from copyright infringement.

Dotcom argues that he can't be held responsible for others who chose to use his site for illegal purposes, and that any case against him should have been heard in civil court.

Born in Germany as Kim Schmitz, Dotcom has long enjoyed a flamboyant lifestyle. He was arrested in New Zealand in 2012 after a dramatic police raid on his mansion.

Out on bail soon after, he released a music album, started another internet file-sharing company called Mega, and launched a political party which unsuccessfully contested the nation's 2014 election.

In addition to Dotcom, who founded Megaupload and was its biggest shareholder, the U.S. is also seeking to extradite former Megaupload officers Mathias Ortmann, Bram van der Kolk and Finn Batato.