More than 90 people were injured in the accident in the town of Tianshui in Gansu province.
Nineteen students have been admitted to hospital, three in critical condition.
Local media said the crane was unloading soil about 10 metres from the Number Three Primary School when it suddenly collapsed onto the roof of the three-storey building.
It crashed through to the ground floor wrecking schoolrooms full of pupils.
The crane driver was among those killed.
Investigators are reportedly looking at the possibility of a mechanical fault being to blame.
China has an appalling record of safety in the workplace – in the mining industry alone about 5,000 people are killed every year.
Last month a Chinese Government official described standards of safety in the workplace as “grim”.
He said more often than not workers were unaware of how to take safety measures.
Tags: Crane Collapse