Some parents reported being woken at 3am by the text message, which was also emailed to some parents.

"Feeling so SAD. received a message last night that Castle Hill High had been severely damaged (burnt) and that it was unfit for children to attend school. It just makes me so angry only the hall was spared," wrote one parent on social media, before the prank was exposed.

A NSW Department of Education and Communities spokesman said the message was sent to hundreds of parents who had provided their mobile phone number or email address to the school so they could receive important information.

"The information [in the text and email] was completely incorrect," the spokesman said.

"As soon as we became aware, the correct information that the school was open was sent to those who had received the initial SMS or email, and the school's website has been changed to reflect the information, as has the school's notice board out on the street.