Phillipstown School's bid to stay open has passed its first major hurdle.

A High Court judge today declared the process behind Education Minister Hekia Parata's decision to merge Woolston and Phillipstown schools in Christchurch to be unlawful.

"We're over the moon," Phillipstown School principal Tony Simpson said. "I had the feeling it could go against us. I was told on the phone and tears came to my eyes. This is a big day for Phillipstown and a big day for education in New Zealand."

IAIN MCGREGOR/Fairfax NZ Principal Tony Simpson gets hugs from parents after the decision is announced.

"You can feel the buzz of the parents right now. This is the day that David took on Goliath."

Simpson said the school would keep working constructively with the minister. He had not heard from Parata.

He welcomed enrolments for next year.

TAKING A STAND: Phillipstown School principal Tony Simpson leads a protest against closure.

The school applied to the High Court for orders to set aside Parata's decision to merge the two schools on the Woolston school site from January.

A hearing was held in the High Court at Christchurch this month.

Justice Fogarty found that the ministry's consultation process failed to meet the requirements of the Education Act in two respects.

JOHN KIRK-ANDERSON/Fairfax NZ UNLAWFUL: Education Minister Hekia Parata's decision to merge the schools failed to meet the requirements of the Education Act in two respects, a High Court judge said.

First, the importance of the cost of Phillipstown continuing on its current site was mistakenly played down.

Second, the financial information Parata relied on was not reasonably broken down and explained in a manner that would have enabled a critique.

"These two failures of process led the board to not make submissions on the costs, other than to complain about the inadequacy of information," Justice Fogarty said.

"These failures of process mean that the minister has not lawfully merged Phillipstown with Woolston.

"Her decision is declared unlawful and is not valid."

However, Parata may still have the opportunity to push through the merger.

Justice Fogarty said the errors of process were unintended and could be corrected by the consultation process being resumed.

Parata could then make another decision.

Phillipstown School's board was entitled to costs incurred in the High Court dispute, Justice Fogarty said.

Incoming board chairwoman Alicia Bunge-Krueger was "speechless and absolutely excited" by the decision.

While the battle to stay open was never a matter of cost, the judge's ruling that the board was entitled to costs was "the icing on the cake".

If Parata continued to pursue closure, the board would continue to fight.

However, the focus right now was to return to business as usual, she said.

Parata said she would carefully review today's decision and examine the options available, including continuing consultation with the school.

"These are unique circumstances and, while it is never an easy decision to merge a school, it is clear that Christchurch education needs to be organised differently post the earthquakes," she said in a statement.

Christchurch's eastern suburbs were most affected by the quakes and Census data released this week showed about 10,000 people had left the area.

Staff and parents received the news with shock, tears and cheers.

"We took on the Government and we won. We're a little tiny school and we beat them. And they deserved it," teacher aide Jackie Kissel said.

"We have to wait and see what happens now, but at least we've shown them that we won't give up without a fight.

"It's a good school and we don't deserve to be shut out."

Parent Nicola Holgate attended the court case and said the merger would have destroyed the community.

"It's been a horrible time not knowing what's going on," she said.

"We just feel vindicated that justice has been served."

Pupil Antoinette Blackwood, 8, had been pupil there for four years and liked "how everyone is sharing and caring".

"It's really close to our house and if we got to Woolston it will take ages."

Today was the second time Parata's decision to close a school had been overturned by the High Court.

Her decision to close Nelson's Salisbury School was subject to a judicial review in December and had also been deemed unlawful.

Still, Key said today he had "absolute confidence" in Parata.

"We face court action all the time as the Government; the truth is the Government does lots and lots of things and in a democracy people have absolutely the right to challenge the decision. Many of them go our way, some of them go against us."

He rejected a suggestion by Labour MP Megan Wood that the minister had botched the process.

"The Government will work its way through the issue and have a look. I could make some commentary but I just don't think I'll bother on exactly second guessing the judge. In the end Crown law will go away have a look at that see what happens next and will need to make those decisions. It's not unusual for a judge to say there needs to be more consultation."