A decision to extradite an alleged murderer back to China has been quashed and sent back to Justice Minister Andrew Little for fresh consideration.
But in overturning the decision of former Justice Minister Amy Adams, the Court of Appeal has ruled that Little must address serious questions about human rights in China - including the right to a fair trial and the risk of torture.
Kyung Yup Kim, who was born in Korea but moved to New Zealand when he was 14, is accused by Chinese officials of murdering Peiyun Chen while on holiday in Shanghai in 2009.
If Little does want to extradite Kim, the 99-page judgment goes so far as to direct the Justice Minister to question the diplomatic assurances given by China - including that Kim would not be tortured - given torture is already against the law in China but persists.
Little must also address whether the general human rights situation in China suggests human rights - as defined under international obligations that New Zealand has committed to - are not valued or understood.
If human rights are valued in China, then the Court of Appeal said Little must be satisfied whether the rule of law in China is sufficient to secure those rights, as well as whether the judiciary is free from political control.
The decision of the Court of Appeal, written by Justice Helen Winkelmann, who has since been promoted to Chief Justice, is another twist in the saga which has dragged on for nearly 10 years.
Speaking from the United States where he is a visiting fellow at Harvard Law School, Kim's lawyer Dr Tony Ellis said the Justice Minister faced a "difficult if not impossible task" to extradite his client.
"The lengthy judgment tackles the major human rights issues raised in terms of
international human rights law, and New Zealand Bill of Rights Act, in a very friendly
human rights way.
"It is a judgment that has profound human rights importance
which will resonate through out the Common Law world, it is not just important
in New Zealand," said Ellis.
"The new Minister of Justice, Hon Andrew Little, will have a difficult if not impossible task on the third occasion that a Minister of Justice has to consider Mr Kim's surrender to answer the profound and important questions posed by the Court of Appeal."
Ellis said the Crown could try to appeal the decision to the Supreme Court but that would be difficult given two of the three judges who issued the Court of Appeal decision - Justice Winkelmann and Justice Joe Williams - now sit on the Supreme Court.
A request has been made for comment from the office of Little, who is currently overseas.
The case is the first extradition application in New Zealand sought by China.
Kyung Yup Kim was on holiday in Shanghai in 2009 when Peiyun Chen, a 20-year-old sex worker, was found beaten and strangled.
But Kim had left for South Korea before officials sought him for questioning
China sought his extradition from New Zealand in 2011, when he was arrested and spent five years in jail, without trial, before being released on electronic bail in 2016.
During that time, his extradition was approved in 2015 by Amy Adams, the Justice Minister in the previous National-led government.
Adams agreed to send Kim to China to face trial over the murder, after Chinese officials promised he would not be tortured or executed and that his fundamental rights - such as the right to remain silent - would be protected.
But Kim successfully challenged that decision by judicial review and Justice Jillian Mallon found Adams had been too willing to take Chinese officials at their word.
Justice Mallon said there "substantial grounds for believing torture remained a real issue in China".
She ordered the minister to seek more information and reconsider her decision.
Adams again decided in 2016 to surrender Kim to China, after the Ministry of Foreign Affairs promised to check on Kim's welfare at least once every 48 hours during the investigation in Shanghai, and at least once every 15 days during the trial.
Again, Kim appealed for a judicial review.
But this time, Justice Mallon upheld Adams' decision as Justice Minister. The High Court judge noted there would be "repercussions for the bilateral relationship between China and New Zealand, and China's international reputation" if the death penalty was imposed.
This decision which was again appealed by Kim's legal team, led by human rights expert Dr Tony Ellis, to the Court of Appeal in July last year.
They argued the Justice Minister must not order someone to be surrendered under the Extradition Act if there were "substantial grounds" the person would be in danger of being tortured.
This provision reflects New Zealand's commitment to the International Convention against Torture and other international law obligations.
Other restrictions relevant to Kim's case, is New Zealand cannot surrender someone who might be sentenced to death, or there are compelling reasons which would make it "unjust or oppressive" to send them back.
The issue of whether someone would receive a fair trial is not expressly written into the Extradition Act, but the Court of Appeal said it was "common ground" - on the facts of Kim's case - the Justice Minister should consider fair trial rights in China.
This was because the Extradition Act provides for "any other reason" the Minister considers someone should not be surrendered, which the Court of Appeal interpreted should include New Zealand's obligations under international law.
"The issues on this judicial review are difficult. Mr Kim's is the first occasion on which New Zealand has been asked to extradite to the People's Republic of China. Extradition processes exist to ensure that those who commit crimes cannot escape consequences by fleeing the jurisdiction - that there should be no safe havens for those who commit serious crimes," the Court of Appeal wrote.
"And it is alleged that Mr Kim has committed a very serious crime, a crime in respect of which credible evidence has been gathered by the PRC.
"But on the other hand, the Minister of Justice is asked to return Mr Kim to a country that has a criminal justice system very different to our own, that has not committed to relevant international instruments in the way or to the extent that New Zealand has - a country in which, it is reliably reported, torture remains widespread ... New Zealand has obligations under international law to refuse to return a person to a jurisdiction in which they will be substantial risk of torture, or they will not receive a fair trial."
Foreign Affairs Minister Winston Peters directed specific questions about the matter to Associate Justice Minister David Parker.
Justice Minister Andrew Little is overseas.
But Peters said he had been briefed by the Ministry of Foreign Affairs on the matter, but he said it was a "legal matter" for the Minister of Justice.
He did, however, say that the issue would not have any impact on New Zealand's relationship with China.
Asked why, he said: "Because this is not the first time this has happened".
The final extradition decision was a matter for the Minister of Justice based on his understanding of the law, Peters said.
Asked if extradition was a foreign affairs matter, Peters said: "Our foreign affairs policy is to abide by our laws and, in this case, the person responsible is the Minister of Justice."