The Supreme Court has declared the then National-led government broke the law in 2016 when it cancelled a woman's passport on national security grounds.
The Crown has been ordered to pay the woman $30,000 to cover her legal costs, but the court declined to require further payment - saying if there were issues relating to costs in the lower courts those courts should resolve them.
The ruling decides an eight-year legal battle shrouded in secrecy, and overturns previous rulings by the High Court and Court of Appeal.
As acting Internal Affairs Minister in 2016, Judith Collins suspended the woman's passport for 10 working days while the New Zealand SIS spy agency prepared a report on the danger the woman posed.
That report recommended the woman's passport be cancelled, saying she was planning to go to Syria to join the Islamic State terror group, having been detained in Turkey the previous year on her way to Syria, allegedly to marry an Islamic State fighter.
The woman then flew to Australia, relying instead of her passport on a letter from Australia's entry operations centre approving her to travel there as she was waiting for her Australian passport to be renewed.
Internal Affairs Minister Peter Dunne - after a half-hour classified briefing based on a 20-page briefing paper with references to a further 199 pages of SIS intelligence - then cancelled her passport for 12 months.
In his evidence to the court, Dunne said the SIS assessment set out the view the woman would become further indoctrinated by the Islamic State group if she did travel to Syria, and would "almost certainly ... engage with individuals who encourage acts of terrorism".
He believed it likely she would provide practical support if she married an Islamic State fighter, and contribute technical knowledge.
The Supreme Court has now ruled that cancellation of the passport was unlawful and invalid.
In its judgment released today, the court found the minister did not have reasonable grounds to believe the woman intended to facilitate an act of terror, and the briefing paper provided to the minister by the SIS was not fair, accurate, or adequate.
The judgement said Dunne's reliance on the woman potentially travelling to Syria to join a terrorist group fell short of the requirement under the law that the person be an actual danger to a country, not just a potential one.
The judges also found the law required there be evidence that the passport holder intended to travel and facilitate in a terrorist act, and Dunne did not have reasonable grounds to believe this - a higher standard than just suspecting it.
The woman did not end up going to Syria or returning to New Zealand, and became eligible for a New Zealand passport again in late 2017 but has not applied.
Islamic State remains a designated terrorist entity under the Terrorism Suppression Act.
Director-General Andrew Hampton said the NZSIS was required to provide advice about national security risks to support agencies.
"We take our obligations to prevent individuals seeking to travel overseas with the intention of joining a terrorist organisation very seriously. Since 2016 the NZSIS has reviewed its processes associated with the advice it provides regarding passport cancellation decisions."
He said the SIS would take time to fully consider the Supreme Court judgment to identify any further areas where processes could be improved.