FILE- In this Nov. 2, 2017, file photo a recruiter from the postal service, right, speaks with an attendee of a job fair in the cafeteria of Deer Lakes High School in Cheswick, Pa. Even with fear of a global economic slump depressing stock markets, Friday, Jan. 4, 2019 jobs report for December is expected to offer reassurance that the U.S. economy remains sturdy and on track to expand for a 10th straight year. (AP Photo/Keith Srakocic, File)

FILE- In this Nov. 2, 2017, file photo a recruiter from the postal service, right, speaks with an attendee of a job fair in the cafeteria of Deer Lakes High School in Cheswick, Pa. Even with fear of a global economic slump depressing stock markets, Friday, Jan. 4, 2019 jobs report for December is expected to offer reassurance that the U.S. economy remains sturdy and on track to expand for a 10th straight year. (AP Photo/Keith Srakocic, File)

WASHINGTON (AP) — U.S. employers went on a hiring spree in December, adding a surprising 312,000 jobs and providing a dose of reassurance about the economy after a turbulent few months on Wall Street.

The job gains reported Friday by the Labor Department came despite a trade war with China, a global slowdown and a partial government shutdown now entering its third week.

The nation’s unemployment rate rose slightly to 3.9 percent last month, but that, too, was considered a positive sign, reflecting an increase in Americans beginning to look for work. And average hourly pay improved 3.2 percent from a year ago.

ADVERTISEMENT

Stocks surged on the news, along with word that the U.S. and China will hold trade talks next week and comments from Federal Reserve Chairman Jerome Powell that the Fed will be flexible in judging whether to raise interest rates further. The Dow Jones industrial average shot up 747 points, or 3.3 percent.

President Donald Trump called the job growth “GREAT” on Twitter.

The torrid hiring in December far outstripped the 180,000 jobs investors had been anticipating and could help ease fears that the economy’s expansion — now in the middle of its 10th year — may be coming to an end.

“The labor market is very strong even though the economy appears to be slowing,” said Eric Winograd, senior U.S. economist at the investment management firm AllianceBernstein. “Those two things cannot coexist for very long. Either weakening demand will lead firms to dial back the pace of hiring or the robust pace of hiring will lead firms to ramp back up production.”

In recent weeks, financial markets have plunged amid concerns that the U.S. could be in a recession by 2020. The Dow suffered its worst December since the middle of the Depression in 1931.

Major companies such as Apple say their sales are being jeopardized by the tariff war between Washington and Beijing, and an important gauge of U.S. manufacturing posted its steepest decline in a decade Thursday.

China, the world’s second-largest economy, is also mired in a slowdown, its consumers losing much of their appetite for real estate, iPhones, Ford vehicles and jewelry from Tiffany & Co.

The U.S. government shutdown and Trump’s attacks on the Fed and its chairman over the central bank’s rate increases have also worried investors, though Powell may have eased some of those concerns Friday when he stressed that he would not resign if the president told him to do so.

ADVERTISEMENT

The strong job growth suggests employers believe U.S. consumer spending will stay robust.

Health care and education added 82,000 jobs last month, the largest jump in nearly nine years. Restaurants and drinking places posted a net gain of 40,700 jobs. Builders added 38,000 construction jobs, while manufacturers increased their payrolls by 32,000 workers.

Businesses are still searching for more workers.

Fresh Coat Painters, based in Cincinnati, plans to nearly double the 300 employees who paint homes and businesses as it expands this year across this country. The franchiser is also launching an apprenticeship program to attract workers, in addition to providing higher pay and benefits.

Tara Riley, president of Fresh Coat, said that franchise owners are having to actively search for workers instead of simply posting ads.

“We realized it was a mindset change: You have to be recruiting, rather than hiring,” Riley said.

Still, Kevin Hassett, chairman of the White House Council of Economic Advisers, cautioned on Thursday that the jobs report for January could be weak if the shutdown continues. Job totals could be lowered by hundreds of thousands of government employees being temporarily put out of work.

“So when we see the January jobs number, it could be a big negative,” Hassett said.

In 2018, employers added 2.6 million jobs, or an average of nearly 220,000 a month, according to the Labor Department.

At some point, even if the economy remains healthy, monthly job gains will likely downshift to a more gradual pace. This is because there is a dwindling pool of unemployed people. There were 6.3 million people looking for a job in December, down from 6.5 million a year ago.

“People should not get used to numbers like the one we saw this month,” said Martha Gimbel, director of economic research at the jobs site Indeed. “Eventually, job growth is going to start slowing down. When that happens, we shouldn’t panic.”