Stocks marched broadly higher late Monday afternoon after a cease-fire in the U.S. trade war with China put Wall Street in a buying mood.

The S&P 500 index was on track for its second all-time high in less than two weeks, even though the rally lost some of its early momentum.

Investors snapped up riskier holdings as the world's two biggest economies agreed to continue trade talks. The U.S. agreed to hold off on imposing new tariffs on $300 billion in Chinese goods, although existing tariffs on $250 billion of imports remain in place.

Investors have been worried the fallout from the tariffs could hurt global economic growth and corporate profits. Those concerns prompted the Federal Reserve last month to declare its willingness to cut interest rates if the dispute hurts the U.S. economy.

"It's really a de-escalation of the tough talk we've heard from both sides on tariffs," said Jeff Zipper, managing director at U.S. Bank Private Wealth Management. "It's basically kicking the can down the road with some more optimism that a deal is going to get done and negotiations are going to continue."

Technology stocks and banks accounted for a big share of the gains as traders turned their backs on more defensive holdings, pushing bond and gold prices lower. Utilities and real estate stocks lagged the market in another sign that Wall Street had a bigger appetite for risk.

Chipmakers rallied on plans by the U.S. to loosen some restrictions on sales to Chinese telecommunications company Huawei. Broadcom climbed 3.8% and Micron Technology gained 4%. Technology giants Apple and Microsoft also helped lead gains.

Among financial services companies, Bank of America rose 1.4% and JPMorgan Chase gained 1.7%. Consumer product makers and other consumer companies also rose. Many of those companies, including Nike, have much to gain or lose in the ongoing trade dispute.

Oil prices rose, giving energy stocks a small boost, as OPEC considered extending production cuts.

Wall Street just finished its best month since January and that helped push the S&P 500 index to a 3.8% second quarter gain. The index is now up more than 18% heading into the second half of 2019.

The gains in the first half of the year were marked by months of volatile trading as investors rode the ups and downs of the trade war. That volatility is unlikely to fade as the U.S. and China head into yet another round of trade talks.

The market had a similar bounce back in December when both sides agreed to more talks and negotiations seemed on track. That rally quickly faded as investors complained the agreement didn't resolve the core issues in the dispute.

The key difference this time around is the Federal Reserve. In December, the Fed spooked investors by raising interest rates for the seventh time in two years. Now, the central bank has said it is willing to cut rates in order to shore up the U.S. economy if the trade war crimps growth in what is now the longest economic expansion in U.S. history.

KEEPING SCORE: The S&P 500 index was up 0.7% as of 3:32 p.m. Eastern time. The Dow Jones Industrial Average gained 98 points, or 0.4%, to 26,698. The index had been up 290 points. The Nasdaq composite rose 1%.

SOLID WYNN: Casino operator Wynn Resorts jumped 7.8% after Macau officials reported a 5.9% boost in gambling revenue.

The company has significant operations in the southern Chinese gambling haven. It gets about 75% of its revenue from Macau, according to FactSet data.

CHIPPED POLISH: Beauty products company Coty plunged 15.6% after telling its investors that it will write down $3 billion worth of brands.

The brands were bought from Procter & Gamble in 2016. The company expects the restructuring program to cost it about $600 million through 2023.

PRIVATE TRACKS: Railroad operator Genesee & Wyoming vaulted 9% after it agreed to sell itself to Brookfield Infrastructure and GIC.

The company, which owns 120 short line railroads, is being taken private in a deal valued at about $6.37 billion. Most of its operations are in North America.

CRUDE MEASURES: Rising oil prices gave energy sector stocks a modest boost as OPEC considered extending a deal to cut production. Baker Hughes gained 2.4% and ConocoPhillips added 1.7%.

The oil cartel faces weakening demand as global economic growth slows. The current deal to cut production is meant to help reduce oversupply and push prices higher.

OVERSEAS: The truce between the U.S. and China, along with some upbeat economic data, helped push global shares higher.

Japan's benchmark Nikkei 225 added 2.1% to finish at 21,729.97. Hong Kong's markets were closed for a holiday. The Shanghai Composite rose 2.2% to 3,044.90.

European markets rose broadly. The unemployment rate in the 19 European Union countries that use the euro fell to its lowest in more than a decade in May.

------

AP Business Writer Damian J. Troise contributed to this report.