The recession was hard on men, who saw construction and manufacturing jobs dry up, but the recovery is proving much kinder. In a rare turnabout, men are outpacing women in getting jobs as the economy struggles back to life — and they’re doing it partly by taking work in fields long dominated by women.

Men are accounting for a growing proportion of jobs in the private education and health-care industries — economic bright spots of the past two years. Simultaneously, women are losing teaching and other local government jobs at a disproportionately high rate as municipalities cut back, according to a new study from the Pew Research Center.

The trend is a partial reversal of the recession of 2007 to 2009, when men experienced a much higher rate of job loss than women, with steep losses in the male-dominated manufacturing and construction industries. It also defies the historical trend; women fared better in the job market than men in the aftermath of each of the past five recessions, according to the Pew study, which is based on Labor Department data.

Since the recent recession ended in 2009, men have added 768,000 jobs, while the number of jobs held by women has fallen by 218,000, according to the study.

These are hardly grand times for male workers, though. Unemployment remains a full percentage point higher among men than among women (the rates were about the same before the recession), and 56 percent of unemployed Americans in May were men.

But it is clear that men, having borne the brunt of the downturn, are looking outside their traditional fields to find work. For example, men held about 23 percent of health-care and education jobs before the recession but account for 39 percent of the jobs added in those fields since the summer of 2009.

The shift is apparent in programs that prepare people for the workforce.

At Joliet Junior College in Illinois, for example, the nursing program has had a 10 percent increase in male students over the past five years. During that same period, the number of men studying pharmacy technology rose 125 percent, and there are now 60 men in the radiology technology program, far more than in the past.

Cecile Regner, the school’s dean of nursing, allied health and emergency services, said many of the male students are older and have come from the construction or manufacturing fields or from the military. Most are seeking stability.

“Health care provides good jobs,” Regner said. “In this economy, the fact that they are stable jobs are probably the most important thing. . . . It makes it very appealing.”

Even as historically male-dominated industries remain in the doldrums and men look elsewhere for work, local governments have been slashing their majority-female workforces. Employment in the sector held steady during the recession, but in the past year tens of thousands of schoolteachers and other civil servants have been laid off.

In the past month alone, numerous municipal governments — including Memphis; Tallahassee; Duluth, Minn.; and Nassau County, N.Y. — collectively have laid off hundreds of public-sector employees or said they expect to soon.

In Philadelphia, where the school district already has shed more than 3,000 jobs, more layoffs appear on the horizon. More than 500 layoff notices recently went out to employees of Milwaukee Public Schools. Chicago Public Schools officials are planning to send out roughly 1,000 pink slips in coming days.

Women make up the majority of employees in local government nationwide and have been particularly battered by the recent public-sector layoffs.

“Men were in a deeper hole in terms of jobs lost during the recession, and it make sense that they would come back faster,” said Heather Boushey, senior economist at the Center for American Progress, who has studied differences in employment trends for men and women. “But there’s also a large role played by cuts at state and local governments. We’re laying off teachers around the country.”

Still, something more than sectorial shifts seems to be afoot. According to the Pew study, men have done better than women in 15 of 16 major sectors of employment — in sectors that are male-dominated, female-dominated and evenly divided.

While the Pew researchers were hesitant about drawing firm conclusions from this, one possibility is that men, who are at the moment disproportionately unemployed, are more willing to accept low wages or a job outside their comfort zone than women.

But more fundamentally, with the nation still in the midst of a slow, grinding recovery from the recent downturn, the full results are not in.

“We’re still in rough waters, and this is a recovery where the first two years are telling you what happened in the initial stages of the recovery,” said Rakesh Kochhar, a senior researcher at Pew’s social and demographic trends project who led the study. “The story is still being written, and we don’t know where we’ll end up.”