A district court decision that Kim Dotcom and three other men should be extradited to the United States was so flawed that it never should have been upheld, the men's lawyers have told the Supreme Court.
More than seven years after he was arrested, internet entrpreneur Mr Dotcom and his fellow-accused - Mathias Ortmann, Bram van der Kolk and Finn Batato - are making their final appeal against extradition in the Supreme Court this week.
The United States Department of Justice has been trying to extradite the men since 2012, to face criminal charges related to their defunct file-sharing website Megaupload.
North Shore District Court found in December 2015 that the men were eligible for extradition but they have fought the decision every step of the way, unsuccessfully appealing to the High Court and then the Court of Appeal.
Both higher courts criticised the district court's decision-making process but ultimately confirmed its finding.
Grant Illingworth, the lead lawyer for Mr Ortmann and Mr van der Kolk, told the Supreme Court he would be arguing for the finding to be overturned on several grounds.
Firstly, the actions the men were accused of did not amount to criminal offences in New Zealand and were therefore not extradition offences, he said.
Even if they were, the Crown - on behalf of the US - had not provided sufficient evidence that the offences had occurred, Mr Illingworth said.
Regardless, the district court had made serious errors in its decision and the High Court and Court of Appeal should never have upheld its ultimate finding, he said.
"The district court judge misapplied the law at every stage of the judicial analysis.
"That constituted a serious miscarriage of justice. No higher court could have justified a finding of that kind, no matter how much they agreed with the outcome," he said.
The decision was the "antithesis" of justice.
Dotcom, Ortmann, van der Kolk and Batato were arrested on 20 January, 2012, during a dramatic armed raid on the rural Auckland mansion Dotcom was renting at the time.
The group has maintained in court hearings for the past seven-and-a-half years that Megaupload was created to allow people to store and share large files.
But the FBI, which co-planned the raid with its New Zealand counterparts, claimed the site wilfully breached copyright on a mass scale by hosting illegally-created movie, music and software files.
The agency said the site aided and abetted users who uploaded such files by paying them rewards.
This week's Supreme Court hearing is likely to hinge on whether the actions the men are accused of count as crimes under New Zealand law, either through the Copyright Act or the Crimes Act.
Their behaviour has to be considered criminal in New Zealand as well as the United States for extradition to go ahead.
Canterbury University law professor Neil Boister, who specialises in extradition law, said the Crown - which represents the US in New Zealand - had a much easier task this week than the men's legal team.
Crown lawyers only needed to successfully argue that at least one of the counts on the US indictment is also a crime in New Zealand, and that there was preliminary evidence of the men's behaviour, in order to prevail.
"If they get over this hump, he's probably gone."
If the Supreme Court upholds the extradition finding after this week's hearing, it will be referred to Justice Minister Andrew Little to make the ultimate decision.
If the Supreme Court decision did not go in Dotcom's favour, and the Mr Little decided he should be extradited, a judicial review of the minister's decision offered one last narrow window of escape, Mr Boister said.
"The difference with the judicial review is that you can introduce all sorts of material that's not evidence," he said.
That could include arguments about whether extraditing the men could amount to a breach of their human rights.
"You could introduce Amnesty International reports about the conditions in the US jails and so on."
This week's appeal is being heard by a full panel of the five Supreme Court justices.