(Reuters) - The S&P 500 jumped to a three-week high on Tuesday, led by Apple, Amazon, Facebook and industrial shares on bets that the United States and China would strike a deal to end their trade war.

The three-day rally kicked off on Friday following robust U.S. jobs data and dovish comments on interest rates by Federal Reserve chief Jerome Powell has lifted the S&P 500 .SPX by over 9 percent from 20-month lows touched around Christmas.

The S&P 500 has gained in seven of the past nine sessions.

The United States and China will extend trade talks in Beijing for an unscheduled third day, a member of the U.S. delegation said, as the world’s two largest economies looked to resolve their bitter trade dispute. So far, officials from both sides have sounded optimistic, with President Donald Trump saying talks were going well.

“You’re seeing some negotiations happen and the market is starting to think that perhaps we’ll start to see a framework evolve,” said Anik Sen, global head of equities at PineBridge Investments.

The trade-sensitive S&P industrials sector .SPLRCI rose 1.41 percent. Boeing Co BA.N shares jumped 3.79 percent, contributing the most to the Dow's rise, after the company said it had delivered a record 806 aircraft in 2018.

Apple Inc AAPL.O rose 1.91 percent, regaining some ground after the company last week warned of weaker-than-expected demand for its iPhones. But tech sector gains were limited by a drop in chip stocks after Samsung 005930.KS blamed an estimated 29 percent drop in quarterly profit on weak chip demand.

Slideshow ( 3 images )

The Philadelphia Semiconductor index .SOX slid 0.49 percent. Adding to the woes, Goldman Sachs forecast a tough year for chipmakers, particularly in the first half.

Other investors remained upbeat about upcoming U.S. quarterly results.

“It’s the new year and investors are really stepping back and taking a look at the fundamentals, and realizing it’s not as bad a story as maybe we thought toward the end of the year,” said Jeff Kravetz, a regional investment strategist at U.S. Bank Wealth Management.

The communication services index .SPLRCL climbed 1.58 percent, with Facebook Inc FB.O adding 3.25 percent after JPMorgan said the social media company was among its favorite internet picks for 2019.

Amazon.com Inc AMZN.O rose 1.66 percent, increasing its market capitalization to $810 billion and cementing its position as the most valuable U.S. company.

The Dow Jones Industrial Average .DJI jumped 1.09 percent to end at 23,787.45 points, while the S&P 500 .SPX gained 0.97 percent to 2,574.41. The Nasdaq Composite .IXIC added 1.08 percent to 6,897.00.

Slideshow ( 3 images )

Financials .SPSY was the only S&P index not to gain, ending unchanged as the U.S. Treasury yield curve US2US10=TWEB flattened.

PG&E Corp PCG.N shares continued to decline, falling 7.34 percent after S&P Global Ratings stripped the California power utility of its investment-grade credit rating.

Union Pacific Corp UNP.N rose 8.73 percent after the No. 1 U.S. railroad named industry veteran Jim Vena as chief operating officer.

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

The S&P 500 posted no new 52-week highs and one new low; the Nasdaq Composite recorded 28 new highs and 15 new lows.

Volume on U.S. exchanges was 8.0 billion shares, compared to the 9.0 billion average over the last 20 trading days.

(GRAPHIC: U.S. profit growth since 1968 - tmsnrt.rs/2RzHi550