NEW YORK (Reuters) - U.S. stocks climbed on Monday, but finished off earlier highs, led by gains in technology stocks on optimism for progress in U.S.-China trade talks and signs of a likely reprieve for Chinese telecom company Huawei.

Despite losing some of its initial steam, the S&P 500 still managed to close at a record high after the United States and China agreed on Saturday to resume trade talks. In addition, President Donald Trump also offered concessions including no new tariffs and an easing of restrictions on Huawei Technologies Co Ltd [HWT.UL], while China agreed to make unspecified new purchases of U.S. farm products.

Still, stocks had given up a good portion of their earlier gains as investors contemplated whether the U.S. Federal Reserve would be as dovish as has been anticipated recently and caution crept back in for what is likely to be a lightly traded week due to the July Fourth holiday.

“There was celebration on the open and it was a case where if some of this trade uncertainty goes away, even if it is not solved, so to speak, that decreases the likelihood the Fed needs to step in, or at least step in as aggressively as people were thinking about a week and a half ago,” said Willie Delwiche, investment strategist at Robert W. Baird in Milwaukee.

Tech stocks .SPLRCT, Wall Street's top performers so far in 2019, jumped 1.45%, with heavyweight Apple Inc's AAPL.O 1.83% gain providing the biggest boost.

Chipmakers with a sizable revenue exposure to China jumped nearly 5% at their session high before also pulling back, last showing a 2.65% gain in the Philadelphia Semiconductor index .SOX. Huawei supplier Micron Technology Inc MU.O gained 3.9%.

The Dow Jones Industrial Average .DJI rose 117.47 points, or 0.44%, to 26,717.43, the S&P 500 .SPX gained 22.57 points, or 0.77%, to 2,964.33 and the Nasdaq Composite .IXIC added 84.92 points, or 1.06%, to 8,091.16.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., June 17, 2019. REUTERS/Brendan McDermid/File Photo

Stocks saw their steepest sell-off this year in May, a 6.6% decline, after a breakdown in the U.S.-China trade talks sparked concerns of a global economic slowdown.

But hopes that the Federal Reserve would cut interest rates to preserve a strong run of U.S. economic growth, and a dovish turn by central banks around the globe, helped the S&P 500 and the Dow Jones indexes post their best June performance in decades.

Despite the latest development in talks, traders still anticipate the Fed’s next move will be a rate cut of at least a quarter of a percentage point at its July 30-31 policy meeting.

Data showed growth in manufacturing cooled in the United States in June while factory activity shrank across much of Europe and Asia, further supporting expectations of a rate cut.

Gains on the Dow were held in check by a 2.1% drop in Boeing Co BA.N after a report that federal prosecutors had subpoenaed records relating to the production of the 787 Dreamliner in South Carolina.

Wynn Resorts Ltd WYNN.O jumped 5.9%, the most on the S&P, as gambling revenue in the Chinese territory of Macau rose more than expected in June. Shares of peers Melco Resorts & Entertainment Ltd MLCO.O and Las Vegas Sands Corp LVS.N also rose.

Coty Inc COTY.N tumbled 13.5%, falling the most on the S&P, after the company said it would overhaul its operations and write down about $3 billion in value of its brands acquired from Procter & Gamble Co PG.N.

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

The S&P 500 posted 62 new 52-week highs and two new lows; the Nasdaq Composite recorded 122 new highs and 31 new lows.

About 7.04 billion shares changed hands in U.S. exchanges, compared with the 7.15 billion daily average over the last 20 sessions.