The blaze erupted in Orchard Hills along Castle Road prompting closures to the M4 between the Northern Road and Kent Road.
Water bombing aircraft were used to defend the Orchard Hills Primary School as well as several homes and properties in the firing line of the rapidly moving blaze.
A NSW Department of Education spokesperson told 9news.com.au that hundreds of children were evacuated due to the fast-moving nature of the fire.
“On advice from emergency services, the school contacted parents and carers to pick up their children soon after the fire started,” the spokesperson said.
“Some remaining students and all staff were later evacuated to Kingswood High School. All are safe and accounted for. There has been no damage to the school.
Read Related Also: CBS News: Hunter Biden's former business partner never got a chance to go before a grand jury
“Parents and carers have been notified of alternative pick-up arrangements for students.”
More than 100 firefighters were at the scene to stop the blaze.
It has since been downgraded to an advice alert level as NSW RFS said firefighters and aircraft gained the upper hand.
Two of three eastbound lanes on the M4 have since reopened.