U.S. employers dramatically stepped up their hiring in December, adding 312,000 jobs in an encouraging display of strength for an economy in the midst of a trade war, slowing global growth and a partial shutdown of the federal government.

The Labor Department said Friday that the unemployment rate rose slightly to 3.9 percent, but that reflected a surge in jobseekers— a positive for growth.

Average hourly pay improved 3.2 percent from a year ago, up from average wage growth of 2.7 percent at the end of 2017.

The jolt in hiring offers a dose of reassurance after a tumultuous few months as the outlook from the financial markets has turned decidedly bleaker. Job growth at this pace is a sign that the economy will continue to expand for a 10th straight year, even if overall growth slows somewhat because of the waning stimulus from President Donald Trump's tax cuts.

Although employers are showing their confidence, the financial markets have become increasingly worried.

Major companies such as Apple say their sales are being jeopardized by the tariff-fueled trade war between the United States and China. Factory activity in China and the United States have both weakened, with the Institute for Supply Management's U.S. manufacturing index on Thursday posting its steepest decline in a decade.

The government is about to enter its third week of a partial shutdown, with negotiations stalled over President Donald Trump's insistence that Democrats agree on funding for a wall along the border with Mexico. And attacks by Trump on the Federal Reserve over its rate increases have raised doubts about Chairman Jay Powell's status — a concern for both the markets and the economy.

The expected continuation of steady job growth suggests that such risks might be — for the moment, anyway — overblown. However, the stock market will have to weigh whether the strong job growth encourages the Fed to hike rates in 2019 more frequently than investors had previously anticipated.

The health care, food services, construction and manufacturing sectors were the primary contributors to last month's hiring.

Health care and education services added 82,000 jobs in December, the biggest jump since February 2012. Restaurants and drinking placed 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. The employment site Glassdoor found that job postings have risen 17 percent in the past year to 6.7 million.

"We really don't see any slowdown yet," said Andrew Chamberlain, chief economist at Glassdoor.

Despite the increase in the unemployment rate, the influx of people searching for work coupled with the job gains is an indication that the rate should decline in the coming months. Economists estimate that it requires roughly 100,000 job gains each month to satisfy population growth and keep the unemployment rate at its current level.

Hiring has easily eclipsed that pace. In 2018, employers added 2.6 million jobs, or an average of nearly 217,000 a month, according to the Labor Department.