The Dow Jones Industrial Average returned to a record Monday, joining other market gauges at all-time highs, as the stock market's rally carried into a fifth week.

Oil producers, banks and other stocks that do well when the economy is strengthening again led the way. It's a notable shift in leadership following months of struggles for what Wall Street calls "cyclical" stocks, which lagged due to worries about trade wars and the slowing global economy.

Behind the resurgence for cyclicals are rising hopes that the United States and China are making progress in negotiations on their trade dispute, or at least that they're no longer making it worse. Reports last week also showed the job market is continuing to grow, corporate profits aren't doing as badly as Wall Street expected and interest rates will likely remain low for a while.

Even in manufacturing, which has been hit particularly hard by President Donald Trump's trade war, investors saw some hopes that things may be hitting bottom soon.

The Dow climbed 114.75 points, or 0.4%, to 27,462.11 and surpassed its prior all-time high set in July.

The S&P 500 rose 11.36, or 0.4%, to 3,078.27, and the Nasdaq composite added 46.80, or 0.6%, to 8,433.20. Both the S&P 500 and Nasdaq also clinched records.

"Investors are doing what we're theoretically supposed to be doing: We're looking out at the next 12 to 18 months and investing on the basis of where it's going, not on where we're at today," said Tom Stringfellow, chief investment officer at Frost Investment Advisors.

"We are investing on expectations that whatever the worst is, we're there now."

Of course, all that optimism could wash away quickly if U.S.-China trade talks take yet another turn for the worse, Stringfellow said. But investors likely need to see only incremental improvements, rather than comprehensive deals, to keep the momentum going, he said.

Rising optimism in the market was evident not only in U.S. stock indexes but also in higher yields for Treasuries. When investors feel less need for safety, the crowd thins to buy Treasury bonds. And when prices fall for Treasuries, their yields rise.

"Investors are doing what we're theoretically supposed to be doing: We're looking out at the next 12 to 18 months and investing on the basis of where it's going, not on where we're at today." — Tom Stringfellow, chief investment officer at Frost Investment Advisors

The yield on the 10-year Treasury climbed to 1.77% from 1.72% late Friday. Not only that, the gap between the yields of the 10-year and two-year Treasuries widened, which many on Wall Street see as a sign of increased confidence in the economy.

The two-year yield rose to 1.57% from 1.55%, and the gap between it and the 10-year yield is close to its largest since late July.

Such a widening spread helps banks, which make money by borrowing money at short-term rates and lending it out at longer-term rates.

Financial stocks in the S&P 500 climbed 0.9%, aided by a 1.9% jump for Bank of America and a 1.8% gain for Citigroup.

Other cyclical sectors, such as energy and industrials, were also ahead of the pack.

Chevron jumped 4.6%, and Exxon Mobil added 3% as energy stocks overall climbed 3.1% after the price of oil rose.

A stronger global economy would mean more demand for energy, and benchmark U.S. crude rose 34 cents to $56.54 per barrel. Brent crude, the international standard, rose 44 cents to $62.13 a barrel.

Defensive stocks, meanwhile, lagged. Utilities fell 1.3% for the largest loss in the S&P 500, and real estate stocks were down 1.1%.