The Government's move to close a residential girls' school was unlawful, a High Court judge has ruled.
Education Minister Hekia Parata proposed shutting Salisbury School and moving the students to a boys school in Christchurch next year.
But the school sought a judicial review.
It argued sending the girls to a co-ed school will put them at risk and said there were questions around whether legislative tests had been met.
Justice Dobson said the decision disregarded "the prospect of greater risk of sexual or physical abuse" to the girls if they were sent to a co-ed special needs school.
The Minister is preparing a response.
Salisbury has been open since 1914 and has a roll of 80 students from around the country.
'Warning shot for minister'
Labour says the High Court ruling is "a warning shot for a minister who is running roughshod over due process in Canterbury as well" with plans to close schools there.
Labour's Associate Education spokesperson Chris Hipkins said the ruling is "a victory for the parents' persistence, common sense and proper process".
"It's also a slap in the face for a Minister of the Crown to have their actions ruled unlawful. This must be the end of Hekia's attempts to close Salisbury," Hipkins said.
He said he predicts it won't be the end of these sorts of hearings for Parata who "is making a habit of riding roughshod over communities' concerns and that annoying thing called the law".
"It's time she followed the letter of the law and respected the views of communities. Otherwise she's in for more run-ins with the High Court."
'Minister out of her depth'
The Green Party said the High Court's ruling "is another example of an incompetent minister out of her depth".
"This is a Minster who doesn't listen and is putting our kids
education in jeopardy," said Green Party education spokesperson
"Salisbury school provided Hekia Parata with all the information she needed, including information about specific safety risks to its pupils if it was merged with the boys school, but the Minister chose to ignore that advice."
"The Court has acted to protect Salisbury students because the Minister was putting them at risk.
"Minister Parata has shown time and again that she won't listen to those on the ground in education. In this case they were warning her about the physical safety of the girls at the school."
This is the latest in a long line of failures on the part of Parata and it ought to have repercussions for her as a Minister, Delahunty said.
"Combined with her decisions about Christchurch school closures it seems this Minister is targeting schools with the most vulnerable and fragile students for closure.
The Prime Minster must now look very seriously at whether Hekia Parata is the best person for the job in education, Delahunty said.