The fire is believed to be on the site of Ash Green school in Mixenden, on the outskirts of Halifax.
Footage shows flames coming from the top of the building.
Smoke is billowing across the skyline and many residents took to social media to share footage and pictures of the incident.
It is believed that emergency services are on the scene of the fire.
In a tweet, Holly Lynch said MP: "So so sorry to hear the fire at Ash Green this evening. Thanks to @WYFRSCaldTeam and Police who are at the scene and thinking of @AshGreenHead and all his staff and pupils.
"I know everyone will be willing to move heaven and earth for your pupils in the coming days."
Holy Nativity Church in Mixenden also took to social media to pray for the children.
The tweet read: "Looking on as our school burns comes with a feeling of helplessness as the professionals do their job.
"As we stand together, we pray for all of the staff, pupils at @AshGreenPrimary together with the whole community of Mixenden. We’re thankful for the Fire Fighters and Police."
West Yorkshire Fire Service and West Yorkshire Police have been contacted.
It is unknown if anyone has been injured in the fire at this stage, or any cause.