Wall Street's main indexes all gained more than 2% on Friday after December payrolls expanded more than expected even as wage increases slowed and services activity contracted, easing worries about the Federal Reserve's interest rate hiking path.

U.S. nonfarm payrolls rose by 223,000 jobs in December, Labor Department data showed, while a 0.3% rise in average earnings was smaller than expected and less than the previous month's 0.4%.

In another set of data, U.S. services activity declined for the first time in more than 2-1/2 years in December as demand weakened, with more signs of inflation easing.

"We got good news on the inflation front with wage gains that are slowing. We got participation rates pick up again and yet we're still creating jobs. It's a kind of a win-win for the economy. And on the other side the ISM services report was really weak and broadly weak," said Megan Horneman, chief investment officer at Verdence Capital Management in Hunt Valley, Maryland.

"That's basically making people think the Fed is nearing the end of what's been one of the most aggressive tightening cycles we've seen in decades. That's why the markets are taking off."

By 4:23 p.m. ET, the Dow Jones Industrial Average rose 700.53 points, or 2.13%, to 33,630.61; the S&P 500 gained 86.98 points, or 2.28%, at 3,895.08; and the Nasdaq Composite added 264.05 points, or 2.56%, at 10,569.29.

Friday's rally boosted the benchmark S&P and the Nasdaq enough to snap four weeks of declines. For the holiday-shortened week, the S&P rose 1.45% while the Nasdaq added 0.98% and the Dow advanced by 1.46%.

For the gains, John Augustine, chief investment officer at Huntington National Bank in Columbus, Ohio, pointed to a calming of anxiety that the Fed would raise rates so much that it causes a recession.

"Today's reports may alleviate that pressure to force a recession. They may already have slowed down the economy enough. They just need validation from inflation reports."

Still the Fed last month projected an a interest rate target peak of around 5% and said it would keep rates high until inflation is where it wants it to be.

Fed officials on Friday acknowledged cooling wage growth and other signs of a gradually slowing economy, with Atlanta President Raphael Bostic hinting at the chance of a quarter percentage point hike at the next policy meeting.

But Huntington's Augustine said the central bank needs to see further slowing of price increases in the December inflation report, due out on Thursday, before deciding whether to slow its next rate hike. It raised rates 50 basis points in December.

Also next week several of the biggest U.S. banks including JPMorgan and Bank of America will kick off the fourth-quarter earnings season on Friday.

"That's the part of the puzzle people haven't been able to figure out. How much should earnings estimates be cut for the calendar year or have they been cut enough?" said Horneman at Verdence.

All the major S&P 500 indexes gained with materials' 3.44% increase leading the pack. Interest-rate sensitive technology was next with a 2.99% gain.

The weakest sector was healthcare, which rose 0.89% followed by energy's 1.68% increase.

Consumer staples was boosted by Costco Wholesale Corp, whose shares jumped 7% after the membership-only retailer reported strong December sales growth.

Shares in Biogen Inc closed up 2.8% after the U.S. Food and Drug Administration on Friday approved the Alzheimer's drug lecanemab developed by Eisai Co Ltd and Biogen for patients in the earliest stages of the disease. Eisai's U.S. shares closed up 4% at $64.20.

Pfizer Inc shares advanced 2.5% after reports of talks with China to secure a license that will allow domestic drugmakers to manufacture and distribute a generic version of the U.S. company's COVID-19 antiviral drug Paxlovid in China.

Bed Bath & Beyond Inc tumbled 22% after Reuters reported that the home goods retailer was preparing to seek bankruptcy protection in coming weeks.

Advancing issues outnumbered decliners on the NYSE by a 6.69-to-1 ratio; on Nasdaq, a 2.59-to-1 ratio favored advancers.

The S&P 500 posted 18 new 52-week highs and five new lows; the Nasdaq Composite recorded 97 new highs and 65 new lows.

On U.S. exchanges 11.15 billion shares changed hands compared with the 10.84 billion average for the full session over the last 20 trading days.

(Reporting by Shubham Batra, Ankika Biswas and Shashwat Chauhan in Bengaluru; Editing by Shounak Dasgupta, Arun Koyyur and Richard Chang)