The Dow Jones Industrial Average joined other major indexes in record territory Monday, with stocks propelled higher as optimism about a near-term U.S.-China trade resolution and a third-quarter earnings season that has been better than feared buoyed sentiment on Wall Street.

The Dow Jones Industrial Average DJIA, +1.33% advanced 114.75 points, or 0.4%, to finish at 27,462.11, surpassing its previous record close of 27,359.26, set on July 15. The Nasdaq Composite COMP, +2.26% gained 46.80 points, or 0.6%, to close at 8,432.20, while the S&P 500 index SPX, +1.59% rose 11.36 points, or 0.4%, to end at 3,078.27. The Nasdaq and S&P 500 ended at record highs for the second consecutive session.

All three equity benchmarks also hit all-time intraday highs. The last time the three major indexes ended at record highs on the same day was July 15, according to Dow Jones Market Data.

Read:Dow and S&P 500 are set to rise at least another 5% in the next 2 months — if this pattern holds

What drove the market?

Wall Street investors saw a fresh round of records amid the latest developments on a so-called phase one agreement between China and the U.S.

On Sunday, U.S. Commerce Secretary Wilbur Ross said that licenses for companies to do business with China’s Huawei Technologies Inc. will be coming “very shortly” and expressed optimism about a pact. However, he said a preliminary deal might not be ready to be signed this month: “We’re in good shape, we’re making good progress, and there is no natural reason why it couldn’t be.” Ross offered Iowa, Hawaii and Alaska as possible sites for a meeting between Presidents Donald Trump and Xi Jinping to sign the deal, during an interview with Bloomberg Television in Bangkok, on the sidelines of the Asean summit.

“The market is enjoying relief from a couple different factors,” Keith Buchanan, senior portfolio manager at Globalt Investments told MarketWatch. “The angst over trade is subsiding and, from an earnings standpoint, corporations are beating a lowered hurdle, while guidance for next year has been better than feared.”

Friday data showed that the U.S. economy created 128,000 new jobs in October, above economists’ estimates of a 75,000 gain, while the unemployment rate ticked higher to 3.6%, in line with expectations.

Meanwhile, market watchers also have characterized quarterly results thus far as better-than-expected, a belief that has underpinned current buoyant sentiment.

Of the 356 companies in the S&P 500 that have reported third-quarter earnings so far, 75.8% have reported earnings per share that exceeded analysts’ estimates, according to data from Refinitiv, above the average 65% beat rate since 1994, putting the index on pace for an overall decline in earnings of 0.8%, up from a predicted 2.2% contraction on Oct. 1.

Stocks considered defensive in nature suffered Monday, as investors sold these in favor of shares of companies in cyclical sectors that tend to do well during periods of strong economic growth. The utilities sector was the worst performing on the 11 in the S&P, as shown by the 1.5% decline in the Utilities Select Sector SPDR Fund XLU, +1.64% . Other defensive sectors, consumer staples and real estate were also down on the day.

CFRA Analyst Sam Stovall downgraded his view of the utilities sector Monday to underweight from marketweight citing the run up in prices of these stocks in recent months. The utilities sector has gained 18.9% during the previous 12 months. Only information technology and real estate have performed better during that stretch.

Meanwhile, investors also were processing developments around Dow component McDonald’s Corp. MCD, +0.95% , after the fast-food restaurant chain said it fired Chief Executive Steve Easterbrook because of his consensual relationship with an employee. Shares of the company fell 2.7%, Piper Jaffray downgraded the fast-food giant to neutral from overweight over Easterbook’s departure.

Read:McDonald’s downgraded after CEO Easterbrook ouster over concerns about stock disruption

Also see:Here’s why McDonald’s investors are upset Easterbrook is out as CEO

As for the Federal Reserve, Minneapolis Fed President Neel Kashkari said the central bank may not cut rates further as long as growth maintained its current solid pace. This comes after the Fed lowered interest rate for the third time this year, but suggested it would stay on pause.

What other companies were in focus?

Berkshire Hathaway Inc. BRK.A, +0.43% BRK.B, +0.82% reported third-quarter net earnings of $16.5 billion, or $10,119 per Class A share equivalent, from $18.5 billion, or $11,280 a share, in the year-earlier period. Last year’s third-quarter earnings surged due to unrealized investment gains. Berkshire’s Class A shares rose 1.1% and its Class B shares gained 1%.

Under Armour Inc. UA, +1.55% UAA, +1.36% said regulators are examining whether the sportswear maker shifted sales from quarter to quarter to appear healthier, according to people familiar with the matter. Shares of Under Armour retreated 17.9%, its biggest percentage drop since Oct. 31, 2017 when the stock tumbled 23.7%.

Shares of ride-hailing company Uber Technologies UBER, +3.32% will be in focus as the company is set to report quarterly results after the market closes on Monday. Uber’s stock lost 0.9%.

BlackBerry Ltd. BB, +0.42% stock inched up 2.2% after analysts at Bank of America Merrill Lynch raised its stock price target to $7, from $6.

Gannett Co. Inc. shares GCI, +0.80% fell 0.3%, after the USA Today parent topped earnings expectations, though it lowered its full-year revenue forecast.

How are other markets trading?

The yield of the 10-year U.S. Treasury note TMUBMUSD10Y, 0.657% rose 5.4 basis points to 1.782%, after notching on Friday its largest weekly slide since Oct. 4.

West Texas Intermediate crude oil for December delivery US:CLZ19 rose $2.02, or 3.7%, to settle at $56.20 a barrel on the New York Mercantile Exchange, while gold for December US:GCZ19 on Comex inched down by 30 cents, or 0.02%, to settle at $1,511.10 an ounce after notching a 0.4% weekly advance based on the most-active contracts.

The ICE U.S. dollar index DXY, +0.23% , a gauge of the greenback’s performance against its major rivals, rose 0.3% at 97.550.

In Asia overnight, the China CSI 300 000300, +0.15% added 0.7%, Hong Kong’s Hang Seng Index HSI, -0.32% advanced 1.7%. In Europe, stocks closed mostly higher, as reflected in the Stoxx Europe 600’s SXXP, -0.09% 1% gain.

— Mark Decambre contributed to this article.