American employers added an unanticipated barrage of workers in May, reaffirming the labor market’s vigor.

Defying expectations of a slowdown, payrolls grew by 339,000 on a seasonally adjusted basis, the Labor Department said on Friday. The increase, the largest since January, suggested that the job market was still piping hot despite a swirl of economic headwinds.

But below the surface, the report also offered evidence of softening. The unemployment rate, while still historically low, jumped to 3.7%, the highest level since October. In a sign that the pressure to entice workers with pay increases is lifting, wage growth eased.

The dissonance offered a somewhat muddled picture that complicates the calculus for the Federal Reserve, which has been raising interest rates for more than a year to temper the labor market’s momentum and rein in price increases. Fed officials have indicated that the jobs report will be an important factor as they decide whether to raise interest rates again.

“We’re still seeing a labor market that’s gradually cooling,” said Sarah House, an economist at Wells Fargo. “But it’s at a glacial place.”

President Joe Biden hailed the report, saying in a statement that “today is a good day for the American economy and American workers.” The S&P 500 index rose 1.5% as the data portrayed an economic engine that was running strong but not overheating.

Looming over the report is the debt ceiling deal approved by Congress, although economists largely expect the spending caps and cuts to have only marginal impact on the labor market going forward.

The hiring numbers suggest that employers remain eager for workers even in the face of high interest rates and economic uncertainty. Many are still bringing on employees to meet consumer demand, especially for services. The only major sectors to lose jobs were manufacturing and information.

Powering the job gains were professional and business services, including accounting and bookkeeping, which added 64,000 jobs. Leisure and hospitality businesses — buoyed by restaurants and bars — added 48,000 jobs, as Americans continue to dine out with relish. Government employment, which is still catching up to pre-pandemic levels, also rose significantly, predominantly at the state and local level.

In a surprise, the construction sector, which is sensitive to rising interest rates, grew by 25,000 jobs.

“There is a lot of optimism that still exists,” said Tom Gimbel, the founder and CEO of LaSalle Network, a national staffing and recruiting firm. “If the Fed would slow down right now, consensus seems to be — from the small- to medium-sized business CEOs that I talk to — that the economy could continue to be strong for the next 24 to 30 months.”

Labor force participation was relatively unchanged in May, at 62.6%, while the share of people in their prime working years — 25 to 54 years old — participating in the labor market edged up to 83.4%, a level not seen since 2007.

The figures in Friday’s report are preliminary and will be revised at least twice. Upward revisions to the previous two months’ data added 93,000 jobs, making the gradual hiring slowdown appear even more incremental.

At the same time, notes of caution are reverberating through the labor market and the broader economy. Wage growth slowed in May, with hourly earnings increasing 0.3% from April, and 4.3% from a year earlier.

The number of hours worked ticked down slightly, and it is roughly in line with its pre-pandemic level. “If that number descends for quite some time, that is seen as a sign that the labor market is about to significantly cool off,” said Nick Bunker, the director of North American economic research at the job search website Indeed.

That would indicate that higher interest rates are achieving the Fed’s aim, but not without pain. Notably, the unemployment rate for Black Americans, which in April reached its lowest point on record, rose nearly a full percentage point in May, to 5.6%.

“It looks as though conditions are slackening and affecting the most vulnerable, low-wage, minority workers the most,” said Julia Pollak, the chief economist at ZipRecruiter.

The uneven message in Friday’s report is in part because it consists of two surveys, one of employers and one of households. For example, the weakness in the household survey stemmed partly from a decline in the ranks of the self-employed — workers who are not counted in the tally of payroll jobs.

Forecasters continue to expect the labor market to weaken in the second half of the year as interest rate increases take firmer root.

Already, consumer confidence is weak. Sectors including banking and manufacturing have shown clear signs of distress. In its most recent region-by-region survey, known as the Beige Book, the Fed reported that many businesses said they were “fully staffed” while some said they were “pausing hiring or reducing head counts due to weaker actual or prospective demand or to greater uncertainty about the economic outlook.”

A big question is whether deeper cracks will emerge — and when.

One piece of that puzzle is layoffs, which have stayed low outside of some big-name companies in the technology and media sectors. Instead, many businesses remain reluctant to let go of employees, preferring instead to shrink their staffing levels through attrition.