Christchurch's Redcliffs School will stay open, Education Minister Hekia Parata has announced.
"Tears of joy" greeted the announcement in a community that has been fighting for its local school since the 2011 Christchurch earthquake.
Parent Zoe Fidler reacted to the news by posting: "Tears of joy in this house. So proud of everyone, especially our teachers, BoT and principal."
Lisa Williams was also "proud and emotional".
"An educated community, a fair fight and we got there. Thank you to everyone who stood with us."
Port Hills Labour MP Ruth Dyson said the "roofs of the classrooms will have been lifting up with all the cheering".
"It's a great result. The board, particularly, but also the Redcliffs community should be patting themselves on the back for the fantastic work they've done," she said.
"They've been out of the school since June 2011, so it's been a long time. But when the Minister briefed me this morning, she said they have been exemplary in their response to her conditions. They deserve all the praise they are getting."
Parata had announced in November last year that the school would close because of the risk of falling rocks from the cliff behind the site. But she said today she changed her mind based on engineering advice.
"I am advised that the concerns leading to my interim decision have been addressed, and have therefore decided not to confirm my interim decision that the school should close," Parata said.
The primary school has been operating at the van Asch Deaf Education Centre in nearby Sumner since the February 2011 earthquake.
More than 3000 submissions favoured the school staying open.
In March, the school's board filed a submission with a geotechnical report refuting claims of a potential rock fall causing a safety risk or disruption.
Three board members met Parata in Wellington today.
The school and ministry will now discuss whether the school returns to its original site or move permanently. She said the ministry will look at Barnett Park and other possible sites for the school.
A decision is expected by mid-October.
In the meantime, Redcliffs students will stay at the Van Asch Deaf Education Centre.
Parata said further specialist advice will also be sought about the possibility of negative psychosocial effects for children going to school on the original Main Rd site, after the board raised concerns about the potential closure.
"The ministry also asked whether there could be negative psychosocial effects for children if the school returns to Main Rd, where there will be ongoing rockfalls and land mass movement. The specialist concluded that there could be a psychosocial risk to children attending the school on that site."
Parata said the decision whether the school would return to its original site would also depend on that advice, due by the end of September.
The views of the board, parents and the wider community will be important in this phase, Parata said, and the ministry will also work closely with the Christchurch City Council.
Board chairman Mark Robberds welcomed the "fantastic" news.
"The axe we have been living under has gone. [It's] great news for our community," he said.
The school will now work with the ministry and the city council as they decide whether the school will return to the modified site, or to a new site.
• Original site: 140 Main Rd, Redcliffs
• Temporary site where the school has been operating since 2011: van Asch Deaf Education Centre in Sumner
• Nearby Barnett Park in Redcliffs will now be considered as a possible alternate site for the school