NEW YORK (Reuters) - U.S. stocks climbed on Friday, with the S&P 500 and the Nasdaq hitting their highest levels in two weeks, as strong U.S. jobs growth blunted the impact of an escalating U.S.-China trade dispute.

Nonfarm payrolls increased by 213,000 jobs last month, the U.S. Labor Department said, topping expectations of 195,000, while the unemployment rate rose from an 18-year low to 4 percent and average hourly earnings rose 0.2 percent. The moderate wage growth allayed fears of a strong buildup in inflation pressures and boosted optimism that the Federal Reserve would stay on a path of gradual interest rate increases.

“This really is the best outcome we could have hoped for, more jobs without a whole lot of wage pressures,” said Kim Forrest, senior portfolio manager at Fort Pitt Capital Group in Pittsburgh.

The positive news from the U.S. employment report offset, at least for the moment, heightened trade tensions between the United States and China. The two countries slapped tit-for-tat tariffs on $34 billion worth of each other’s imports on Friday. Beijing accused the White House of triggering the “largest-scale trade war.”

Some investors were encouraged that the value of goods targeted for tariffs so far is smaller than amounts mentioned in previous threats. U.S. President Donald Trump has warned that the United States may ultimately target over $500 billion worth of Chinese goods, an amount that roughly matches its total imports from China last year.

“Even though there is an ongoing trade spat, it’s going to be measured, not $500 billion all at once,” said Jamie Cox, managing partner at Harris Financial Group in Richmond, Virginia. “It gives the opportunity for negotiations to happen and doesn’t torpedo the economy, which is what people were concerned about.”

The Dow Jones Industrial Average rose 99.74 points, or 0.41 percent, to 24,456.48, the S&P 500 gained 23.21 points, or 0.85 percent, to 2,759.82 and the Nasdaq Composite added 101.96 points, or 1.34 percent, to 7,688.39.

Slideshow ( 3 images )

All of the 11 major S&P 500 sectors posted gains.

For the week, the Dow increased 0.7 percent, the S&P 500 rose 1.5 percent, and the Nasdaq gained 2.4 percent.

Although U.S. stocks appeared minimally affected by American and Chinese tariffs going into effect, some investors warned that prolonged trade tensions could roil the markets, as they have on several occasions this year.

“You’re going to get some stalling of the market, should trade issues begin to accelerate,” said Gerry Sparrow, a portfolio manager for Interactive Brokers Asset Management, a Boston-based online investing company.

Shares of Biogen Inc rose 19.6 percent, their biggest percentage gain in more than a decade, after the company and Japanese drugmaker Eisai Co said their Alzheimer’s drug showed promise in a mid-stage trial. Biogen led the S&P 500 in percentage gains and was among the biggest boosts to the index.

The S&P 500 healthcare index rose 1.5 percent, the greatest percentage gain among the S&P’s major sectors, while the Nasdaq biotech index jumped 3.7 percent.

Slideshow ( 3 images )

Besides Biogen, technology heavyweights Apple Inc, Microsoft Corp and Facebook Inc provided the biggest boosts to the S&P 500. The S&P technology index rose 1.2 percent.

Advancing issues outnumbered declining ones on the NYSE by a 2.99-to-1 ratio; on Nasdaq, a 2.32-to-1 ratio favored advancers.

The S&P 500 posted 22 new 52-week highs and two new lows; the Nasdaq Composite recorded 125 new highs and 17 new lows.

Volume on U.S. exchanges was 5.30 billion shares, compared with the 6.98 billion average over the last 20 trading days.