In this Feb. 9, 2017, file photo traders work the floor at the New York Stock Exchange. The U.S. stock market opens at 9:30 a.m. EDT on Friday, July 6, 2018. (AP Photo/Mark Lennihan, File)

Trade war? What trade war?

Wall Street shrugged off the escalation of a trade dispute between the world's two largest economies Friday after the U.S. imposed tariffs on billions in Chinese goods and China responded in kind.

After a wobbly start, U.S. stocks were moving broadly higher, placing the market on track for a weekly gain after two weeks of losses.

The market's reaction suggests investors are betting that Washington and Beijing will work out a deal before their trade dispute begins to weigh on corporate profits and the global economy.

"Who would have thought? The first shots of the trade war, and yet the markets are still amazingly resilient," said Erik Davidson, chief investment officer at Wells Fargo Private Bank. "The market is counting on this to subside. If they get an indication that this will continue to escalate, that will cause some problems."

The S&P 500 index rose 24 points, or 0.9 percent, to 2,761 as of 2:12 p.m. Eastern Time. The Dow Jones Industrial Average gained 142 points, or 0.6 percent, to 24,499. The Nasdaq composite added 93 points, or 1.2 percent, to 7,679. The Russell 2000 index of smaller-company stocks picked up 15 points, or 0.9 percent, to 1,694.

The stock market's benchmark index, the S&P 500, posted two consecutive weekly declines heading into this week as investors worried over rising global trade tensions. That effectively means the market had already priced in, or accounted for, the risks of a stepped-up trade conflict.

The U.S. slapped a 25 percent tax on $34 billion worth of Chinese imports. China retaliated with taxes on an equal amount of U.S. products, including soybeans, pork and electric cars, calling the move the start of the "biggest trade war in economic history."

Though the first exchange of tariffs is unlikely to inflict much economic harm on either nation, the damage could soon escalate. President Donald Trump, who has claimed that winning a trade war would be easy, has said that he's prepared to drastically raise tariffs on more Chinese imports. Mounting tariffs could raise costs across the board for consumers and businesses, slowing growth and investment and hurting companies that rely on imported parts to make their goods.

Investors also welcomed new data Friday from the government showing that U.S. employers kept up a brisk pace of hiring last month, without having to hike wages much. Markets have been watching to see if tight labor market conditions would force wages higher, a sign of inflation.

The Labor Department said that U.S. employers added 213,000 jobs in June. Average hourly pay rose just 2.7 percent from a year earlier, which means that after adjusting for inflation wages remain nearly flat.

Health care stocks posted the biggest gains, led by Biogen. The drugmaker's stock soared 17.5 percent to $351.15 on encouraging results from an Alzheimer's therapy.

Technology companies and banks also notched solid gains. Advance Micro Devices rose 5.2 percent to $16.30 and Charles Schwab gained 2.7 percent to $50.83.

Shares in PriceSmart slumped 9.5 percent to $84.55 after the warehouse club operator reported earnings that fell short of analysts' forecasts.

U.S. crude oil prices reversed an early slide. Benchmark U.S. crude gained 82 cents, or 1.1 percent, to $73.76 per barrel in New York. Brent crude, used to price international oils, lost 23 cents to $77.16 per barrel in London.

Energy stocks moved higher along with the rebound in U.S. crude oil. Helmerich & Payne added 2.6 percent to $65.36.

Bond prices were little changed. The yield on the 10-year Treasury held at 2.83 percent.

The dollar fell to 110.48 yen from 110.68 yen on Thursday. The euro strengthened to $1.1747 from $1.1680.

Gold dropped $3 to $1,255.80 an ounce. Silver slipped 3 cents to $16.07 an ounce. Copper was little changed at $2.82 a pound.

Major indexes in Europe finished higher. Germany's DAX added 0.3 percent, while France's CAC 40 rose 0.2 percent. Britain's FTSE 100 gained 0.2 percent.

Asian markets erased earlier losses to finish mostly higher as the uncertainty ended over whether Washington would escalate tensions with Beijing. Hong Kong's Hang Seng index gained 0.5 percent, while South Korea's Kospi added 0.7 percent. Tokyo's Nikkei 225 jumped 1.1 percent after a four-day losing streak. Australia's S&P-ASX 200 rose 0.9 percent.