The headmaster of a primary school in North China's Shanxi province has become an online hit after leading his students do fancy shuffle dance during class break.

In a video that went viral on internet, students of the Xiguan Primary School shuffle their feet, and move their arms enthusiastically following the lead of the headmaster Zhang Pengfei.

Unlike daily calisthenics commonly seen in Chinese schools, the shuffle dance featuring fast heel-and-toe actions has become a morning exercise routine at the school.

Zhang started to teach pupils the dance two months ago in hope of encouraging them to enjoy outdoor activities instead of staring at computer screens and mobile phones, according to a report of Xinhua News Agency.

Zhang learned the movements himself from dancers on a public square in the town.

The "magic dance" soon went viral on internet.

"It is a great way to start the day. It gets your whole system going," one YouTube user commented.