When Iranian schoolteacher Ali Mohammadian noticed that one of his students was being bullied after going bald as a result of a mysterious illness, he decided to show solidarity and shave his own hair. In no time, his entire class shaved their heads and the bullying stopped.

Now, Mohammadian, who teaches at Sheikh Shaltoot's elementary school in Marivan, a Kurdish city in the west of Iran, has become a national hero. President Hassan Rouhani has praised him, the government has offered financial support for the pupil's medical treatment and his story has reached the four corners of his country.

"I'm so happy that this has touched many hearts and people reacted enormously positive," the 45-year-old teacher told the Guardian by phone from Marivan. "Everyone in the school now wants to shave their head."

Earlier this month, Mohammadian posted a picture of himself with eight-year-old Mahan Rahimi on Facebook. "Our heads are sensitive to hair," he wrote on the social network in support of his student. "Mahan had become isolated after going bald, smile had disappeared from his face and I was concerned about his class performance. That's why I thought about shaving my head to get him back on track."

Mohammadian's Facebook post soon caught the eyes of hundreds of Iranian web users. "When I logged in to my Facebook the next day, I couldn't believe the number of people who had liked it and shared it," he said.

Iranian media, including national TV, interviewed him and Iran's education minister, Ali Asghar Fani, soon invited both to Tehran for a formal thank-you. The governor of the Kurdistan province, Abdolmohammad Zahedi, also conveyed the president's message to him.

In a matter of days, Mohammadian's 23 other students in the class were inspired by their teacher's action and insisted that they, too, wanted to shave their heads. "I told them to wait until the winter's cold weather was over but when we came back from Tehran, they had all shaved," he said. "This Saturday morning I stepped into the class and everyone had gone bald."

Doctors at the Razi hospital in Tehran told state television that Mahan had problems with his immune system but they were investigating the exact nature of his disease. According to the teacher, medics in Tehran have also sent samples to Germany for a possible diagnosis. "Mahan's classmates have since become supportive of him and a smile is back on his face," said the teacher.

Mohammadian has 23 years of teaching experience and has two daughters and a son. "In places like Syria and Iraq or Sudan, children are being killed every day and in places like Pakistan and India child labour is widespread. I'm extremely worried about the horrific ordeals those children face on a daily basis."