WASHINGTON (AP) — America’s employers shrugged off high inflation and weakening growth to add 372,000 jobs in June, a surprisingly strong gain that will likely spur the Federal Reserve to keep sharply raising interest rates to try to cool the economy and slow price increases.

The unemployment rate remained at 3.6% for a fourth straight month, the government said Friday, matching a near-50-year low that was reached before the pandemic struck in early 2020.

The robust pace of hiring shows that businesses still want to add workers to meet high customer demand — a trend that should ease concerns that the U.S. economy might be on the verge of a downturn. The durability of the job market suggests that the economy remains on firm footing, at least for now.

“For all the doom and gloom that’s in the markets right now, companies themselves still seem pretty upbeat on their own progress,” said James Knightley, chief economist at ING, a bank. “It sort of dampens the near-term fear that we’re heading into an impending recession.”

Numerous sectors of the economy posted strong job gains in June. Health care added 78,000, transportation and warehousing 36,000 and professional services — a category that includes accounting, engineering, and legal services — gained 74,000. And a sector that includes mainly restaurants, hotels and entertainment jobs added 67,000.

John Schall, the owner of a Boston-based Tex-Mex restaurant chain called El Jefe’s Taqueria, is enjoying strong sales growth and says he’s optimistic about his business. He plans to open his eighth restaurant next week in Pittsburgh. Schall has hired five managers there and will add up to 30 hourly workers.

Having opened six stores in the chaotic two years since the pandemic struck, he is relatively unfazed by inflation and supply chain problems. His sales are growing 25%-30% a year.

“All of them are issues, but overall, I couldn’t be more excited about where we’re at and where we’re going,” Schall said.

Rising prices have eroded his profits, he said, but he thinks inflation will prove temporary, so he isn’t planning price increases beyond one that he imposed nine months ago. Schall is trying to boost the efficiency of his workers, such as buying a machine to do most of the slicing and dicing of the onions, tomatoes and plantains the restaurant uses.

Still, there is plenty of uncertainty clouding the economy’s future path. Economic growth has likely been negative for two straight quarters, consumers are slowing their spending with inflation at a four-decade high and home sales have fallen as the Fed has jacked up borrowing costs. Hiring could weaken in the coming months as the Fed’s rate hikes increasingly take effect.

And some companies are announcing layoffs, or have paused hiring. In particular, several large retailers, including Walmart and Amazon, have said they over-hired during the pandemic, with Walmart reducing its headcount by attrition.

Tesla is cutting about 3.5% of its total headcount. Netflix has laid off about 450 employees after it reported losing subscribers for the first time in more than a decade. The online automotive retailer Carvana and real estate companies Redfin and Compass have also announced job cuts.

Leah Kirpalani, the founder of Shop Good, a “clean beauty” and wellness business with two locations in San Diego, is watching her sales nervously. She’s noticed that consumers are increasingly focusing on essentials like moisturizers and cleansers. Most aren’t picking up extra products like serums, she said, and they’re being hesitant about trying new products.

For now, she has no plans to reduce staff. But that could change if conditions worsen.

“Until we see a longer downturn,” Kirpalani said, “we will continue to staff appropriately to meet customer expectations.”

The past year’s streak of hiring has itself contributed to inflation and heightened pressure on the Fed to slow borrowing and spending. The central bank has already embarked on its fastest series of rate hikes since the 1980s. Additional large rate increases would making borrowing much costlier for consumers and businesses and increase the risk of a recession over the next year.

The Fed may regard the June job gain as evidence that the rapid pace of hiring is further feeding inflation as companies raise pay to attract workers and then increase prices to cover their higher labor costs. Many employers are still struggling to fill jobs, especially in the economy’s vast service sector, with Americans now traveling, eating out and attending public events with much greater frequency.

When the government reports on June’s inflation figures next week, it will likely remain high and could even increase from the 8.6% year-over-year reading in May. But many economists expect it to decline after that.

Wages continued to grow in June, though at a slightly slower pace than they did earlier this year. More modest wage gains could help moderate inflation. Average hourly pay rose 5.1% to just above $32 last month, a much bigger increase than before the pandemic though not enough to keep pace with inflation. Wage growth is down from a 6% pace late last year.

For now, there are roughly two posted job openings for every unemployed worker. And the number of people seeking unemployment benefits — a proxy for layoffs and an early indicator of a downturn — remains far below historic averages, although it has ticked up recently.

Fed Chair Jerome Powell has held out hope that the economy will continue to expand even as the central bank raises borrowing costs at its fastest pace since the late 1980s. But Powell has also acknowledged that overseas factors, such as Russia’s invasion of Ukraine, which has elevated gas and food prices, will make it difficult to avoid a recession.

Last month, he conceded that a recession “is not our intended outcome but it’s certainly a possibility.”

The job market’s recovery has been much more rapid after the pandemic recession than previous downturns. The economy has now recovered all the private-sector jobs lost to the pandemic, a little over two years after the recession. It took almost five years to reach that level after the 2008-2009 downturn.