(Reuters) - The S&P 500 and the Dow industrials ended little changed on Friday, hitting record highs in the session, as the United States and China announced an initial trade agreement, cooling tensions that have rattled markets.

FILE PHOTO: Traders work on the floor of the New York Stock Exchange shortly after the opening bell in New York, U.S., December 3, 2019. REUTERS/Lucas Jackson

The S&P 500 technology sector .SPLRCT and the tech-heavy Nasdaq .IXIC finished solidly in positive territory, with gains in Apple Inc AAPL.O providing a boost.

Trading was choppy following announcement of the agreement, which reduces some U.S. tariffs in exchange for increased Chinese purchases of American farm goods. The United States has agreed to suspend tariffs on $160 billion in Chinese goods that were due to take effect on Dec. 15, a deadline that had been closely watched by investors.

“The risk of trade (dispute) escalation has been averted for now, and that’s a positive,” said Sunitha Thomas, regional portfolio advisor at Northern Trust Wealth Management in Chicago.

Investors were also digesting Prime Minister Boris Johnson’s commanding victory in the British election, which could bring more clarity to the country’s planned exit from the European Union.

“We got confirmation today that two major risks that have been weighing on the market all year have been lifted, for now at least,” Thomas said.

“The market is not up more because we have had some of the rally coming into it, and I think there is now a recognition that there needs to be policy follow-through on the negotiation of Brexit and also what really the details of this deal between China and the U.S. are,” Thomas said.

The Dow Jones Industrial Average .DJI rose 3.33 points, or 0.01%, to 28,135.38, the S&P 500 .SPX gained 0.23 point, or 0.01%, to 3,168.8 and the Nasdaq Composite .IXIC added 17.56 points, or 0.2%, to 8,734.88.

Utilities .SPLRCU led gains among the S&P 500 sectors along with tech, while energy .SPNY and materials .SPLRCM lagged.

The S&P 500 rose 0.7% for the week, its ninth rise out the past 10 weeks.

Improving sentiment about trade tensions, interest rate cuts from the U.S. Federal Reserve and encouraging economic data have fueled records for the major U.S. stock indexes. The benchmark S&P 500 has gained 26% so far in 2019.

Earlier this week, the Fed signaled borrowing costs will not change anytime soon.

In company news, Adobe Inc ADBE.O shares rose 3.9% after it beat Wall Street estimates for fourth-quarter revenue and profit.

Broadcom Inc AVGO.O shares dropped 3.8% after the company provided a lukewarm revenue forecast for 2020.

Oracle Corp ORCL.N shares fell 3.5% after its revenue fell short of quarterly estimates.

Advancing issues outnumbered declining ones on the NYSE by a 1.19-to-1 ratio; on Nasdaq, a 1.07-to-1 ratio favored decliners.

The S&P 500 posted 76 new 52-week highs and one new low; the Nasdaq Composite recorded 128 new highs and 49 new lows.

About 7.4 billion shares changed hands in U.S. exchanges, above the 6.8 billion-share daily average over the last 20 sessions.