NEW YORK (Reuters) - Major U.S. stock indexes registered record closing highs on Thursday as optimism about a U.S.-China trade deal firmed and as Apple and other market heavyweights posted strong gains.

Also helping the market were easing concerns over tensions between the United States and Iran. U.S. President Donald Trump refrained from ordering more military action, and Iran’s foreign minister said the missile strikes on Iraqi bases that house U.S. forces had “concluded” Tehran’s response.

Apple Inc AAPL.O gained 2.1% on twin support from data showing iPhone sales jumped more than 18% in China in December, as well as a price target hike by Jefferies on expectations of a strong finish to 2019. The S&P 500 technology sector .SPLRCT rose 1.1%, the top gainer among sectors.

The financial index .SPSY ended up 0.77% after bullish brokerage comments on Citigroup Inc C.N and Goldman Sachs Group Inc GS.N ahead of their earnings next week.

On trade, China’s commerce ministry said Vice Premier Liu He will sign a Phase 1 deal in Washington next week.

Trump said his administration will start negotiating the Phase 2 trade agreement soon but that he might wait to complete any agreement until after November’s presidential election.

“Some of the things that have been worrying the market have gotten pushed to the side of the table,” said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia.

Slideshow ( 6 images )

But also, he said, “in the first part of the year, there’s always a lot of money that finds its way into the market.”

The Dow Jones Industrial Average .DJI rose 211.81 points, or 0.74%, to 28,956.9, the S&P 500 .SPX gained 21.65 points, or 0.67%, to 3,274.7 and the Nasdaq Composite .IXIC added 74.18 points, or 0.81%, to 9,203.43.

Investors have been closely monitoring tensions between the United States and Iran after the U.S. killing of a top Iranian general last week and Iran’s retaliatory measures this week.

Among the day's decliners was the department store operator Kohl's Corp KSS.N, which slid 6.5% after reporting lower holiday season sales and warning of full-year earnings coming in at the bottom end of an already lowered forecast.

Smaller rival J.C. Penney Co Inc JCP.N tumbled 10.8% after disappointing same-store sales numbers.

With the fourth-quarter earnings season kicking off next week, analysts expect profits for S&P 500 companies to drop 0.6% in their second consecutive quarterly decline, according to IBES data from Refinitiv.

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

The S&P 500 posted 78 new 52-week highs and no new lows; the Nasdaq Composite recorded 152 new highs and 14 new lows.

Volume on U.S. exchanges was 7.30 billion shares, compared with the 7.06 billion-share average for the full session over the last 20 trading days.