by Javier Hernandez - The New York Times

The history class began with a lesson on being manly.

Lin Wei, 27, one of a handful of male sixth-grade teachers at the No. 1 primary school here, has made a habit of telling stories about warlords who threw witches into rivers and soldiers who outsmarted Japanese troops. “Men have special duties,” he said. “They have to be brave, protect women and take responsibility for wrongdoing.”

Worried that a shortage of male teachers has produced a generation of timid, self-centered and effeminate boys, Chinese educators are working to reinforce traditional gender roles and values in the classroom.

In Zhengzhou, a city on the Yellow River, schools have asked boys to sign petitions pledging to act like “real men.” In Shanghai, principals are trying boys-only classes with courses like martial arts, computer repair and physics. In Hangzhou, in eastern China, educators have started a summer camp called “West Point Boys,” complete with taekwondo classes and the motto, “We bring out the men in boys.”

Government officials across China are aggressively recruiting male teachers, as the Chinese news media warn of a need to “salvage masculinity in schools.” The call for more male-oriented education has prompted a broader debate about gender equality and social identity at a time when the country’s leaders are seeking to make the labor market more meritocratic.

It also reflects a general anxiety about boys in Chinese society. While boys outnumber girls as a result of the longstanding one-child policy and a cultural preference for sons, they consistently lag in academic performance. Some parents worry about their sons’ prospects in an uncertain economy, so they are putting their hopes in male role models who they believe impart lessons on assertiveness, courage and sacrifice.

The view that there is an overabundance of female teachers that has had a negative effect on boys has, perhaps predictably, led to a backlash. Parents have accused schools of propagating rigid concepts of masculinity and gender norms, and female educators have denounced efforts to attract more male teachers with lavish perks as sexist.

In Fuzhou, a city of two million, colleges and universities have come under fire for relaxing admissions requirements and offering full scholarships and teaching jobs to young men.

Xue Rongfang, a student at Fujian Normal University, wondered why women should not get similar benefits to enter traditionally male fields. “If women go into architecture, shouldn’t the government give them a free education too?” she said. “Why should men get this benefit?”

In some schools, teachers said the large number of female educators, especially in lower grades, had a positive influence on students.

“We have a more intuitive sense of children’s needs,” said Li Yue, 36, a kindergarten teacher in Fuzhou. “It isn’t the responsibility of schools to teach boys to be boys. It’s the responsibility of parents.”

Chinese education officials, for the most part, appear to disagree. While men are scarce among the ranks of public schoolteachers worldwide, including in the United States, the gender imbalance is especially pronounced in China, where women occupy four out of five teaching positions in urban areas, according to a 2012 study by Beijing Normal University. China has 15 million teachers and about 270 million students.

In some districts, school officials have pressured local officials to intervene, saying students are underperforming because they lack male role models. Boys consistently trail girls on college entrance exams, and disparities in academic achievement emerge as early as third grade, according to a 2012 study by the Shanghai Academy of Social Sciences.

In recent years, education officials in Fujian, Guangxi and Jiangsu have created incentives for male teachers, arguing that men bring an energetic style that appeals to boys.

Still, it is not clear that children derive academic benefits from studying with teachers of the same sex. A 2008 study of 9,000 11-year-olds in Britain found no tie between male teachers and higher academic performance among boys.

Shanghai No. 8 Senior High School began an all-boys program for 60 students in 2012 with the goal of “reviving the masculinity” of its male students.

Zhou Jiahao, 18, a senior at the school, said he did not think China faced a masculinity crisis in its classrooms. But he said boys felt more confident when they took classes together. The school offers courses in etiquette, coding and wilderness survival, among others.

“In classes with female students, we might not dare speak out,” he said. “When it’s just boys, we feel much freer.”

Sun Runxiao, a researcher at the China Youth and Children Research Center and the author of a book on education entitled, “Save the Boys,” said Chinese students were increasingly distant from male role models, including their fathers.

“Children need both female teachers and male teachers for their development,” Mr. Sun said.

A major obstacle to luring more men into teaching are the modest wages paid to educators in China (as elsewhere in the world).

In 2013, the average salary of a teacher at a public school was about $17,000, according to government statistics. While Chinese law dictates that teacher pay should not fall below the salaries of other public servants, enforcement has been inconsistent, and some seek out higher-paying government positions.

In Fujian Province, education officials hope to recruit thousands of male teachers a year, particularly for preschools, where the shortage is most severe.

Of the million or so kindergarten teachers and instructional aides across China, about 60,000, or 6 percent, are male, government statistics show. Retention of male teachers is a serious challenge in China, and many male educators complain that they are lonely and disrespected.

Fujian Normal University admitted its first class of male student teachers under the tuition-free program last fall. Each day, they study for up to 12 hours under the guidance of female professors, who coach them in reading body language and showing empathy. Because they are expected to be in high demand, they are required to gain certification in a number of subjects, including English, math and science.

Wang Ningde, 19, said he hoped to teach Chinese in an elementary school. But he said he was concerned about a perception in some schools that male teachers were untrustworthy.

“If we have only women as teachers,” he said, “we will still have many problems.”

Jiang Weiwen, 19, a first-year student at the university, said many of his friends and relatives were confused when he said he wanted to pursue a career in teaching.

“They asked, ‘Why would a man want to be a teacher?'” he said. “They think men should be ambitious, and that it’s so stable and bland to be a teacher.”

Even on campus, the students are mocked for their career choice, Mr. Jiang said, and some are stereotyped as gay or effeminate.

Mr. Lin, in his classroom in Fuzhou, said he felt a responsibility to teach his students “to be brave.” In his history lessons, he speaks about the physical effort by the men who built the Great Wall. And in a nod to chivalry, he prods boys to apologize to girls when they get into fights.

Each year, he recounts the story of the Five Heroes of Langya Mountain, a tale meant to underscore the importance of sacrifice. In the story, a group of soldiers lures the Japanese Army up a mountain during World War II, giving the Chinese Army time to regroup. The soldiers on the mountain, rather than be killed by the Japanese when they reach the top, jump from the side, shouting, “Long live the Communist Party” as they fall.