A school principal has been sacked and his deputy disciplined for secretly mining digital currency on campus, racking up thousands of dollars in power bills for the school.

Lei Hua, principal of the Puman Middle School in Chenzhou, Hunan province, decided in June last year to mine Ethereum, a type of cryptocurrency.

He spent more than 10,000 yuan (US$1,440) on a “mining” machine but found that he could not pay for the huge amount of electricity needed to run the around-the-clock operation, Hunan Communications Radio reported on Thursday.

Lei moved the machine to a school dormitory, tapping into the school’s free power supply and internet connection, the report said. He then bought seven more machines and moved them into the school’s electronics lab, using 14,714 yuan in electricity in the 12 months till July this year.

Inspired by his boss’s success, Wang Zhipeng, Lei’s deputy, bought a machine and with Lei’s approval, moved the machine into a physics lab, generating a 2,444 yuan power bill for the school.

The nine machines, running 24 hours a day began to strain the school’s electricity system and almost caused a fire, the report said. The internet also became too slow for the classroom.

A teacher responsible for the school’s infrastructure became suspicious and complained to Lei about surging electricity bills, only to be told it must have been an air-conditioning or heating problem. Other teachers complained about noises in the classrooms at night and the slow internet speed, prompting a search – and the discovery of the mining machines.

Lei was sacked as principal and Communist Party secretary of the school while Wang was given a warning from the party.

The party anticorruption watchdog also confiscated the duo’s profits from the operation.