A primary school principal in north China has become the latest internet celebrity for busting some cool moves during a morning exercise routine with his students. 

Every morning, 40-year-old principal Zhang Pengfei at the Xi Guan Primary School in Linyi county, Shanxi province would lead about 700 pupils on the playground in a synchronised 'ghost shuffle' routine - a dance that incorporates contemporary jazz steps with heel, toe and arm movements. 

The bold headmaster thought the fun and energetic exercise routine would better encourage students to get active instead of 'being glued to their mobile phones'.

The school's new 30-minute dance routine has replaced the government-imposed broadcast callisthenics programme, a short workout that has been a requirement at every primary, middle and secondary school in China since 1951.

'I thought we needed a change because the students have been losing interest in doing the broadcast callisthenics routine,' Zhang told Southern Metropolis News.

The dedicated principal said he came across a group of people doing the ghost shuffle routine at a public plaza last summer and decided to learn the dance himself. 

'I thought the dance would be great for kids,' he said. 'The music is full of energy and it really gets the happy feeling flowing.' 

In October, he introduced the choreographed routine to all of his students and shortly after, even teachers and staff were joining in. 

'Now the students aren't constantly on their phones. I sometimes catch them watching different dance routine videos and learning new moves!' the proud headmaster told reporters. 

The video quickly went viral on Chinese social media, with a Weibo topic page titled 'principal leads students in ghost dance routine' gathering 250 million views. 

'This is perhaps the best adaption of sport and entertainment for children,' a comment on Weibo read. 

'This is the coolest headmaster ever! I wish he would teach me,' one user said.