The Government's move to close a residential girls' school in Nelson was unlawful, a 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 School board of trustees chairwoman Helen McDonnell said she felt vindicated with the result, and pleased that common sense had prevailed.
“It’s huge. It’s huge for the families, it’s huge for the girls. We have got mothers who are in tears with happiness.”
The school was hopeful the minister would listen to the judge’s decision and not appeal the process, and was going ahead with planning for the 2013 school year.
"As far as we’re concerned we’re staying open."
Salisbury School is the only residential education and pastoral care centre for girls with complex needs in Australasia. Students are referred there from throughout the country, and are enrolled for up to two years.
The school has been open since 1914 and has a roll of 80 students.