U.S. stocks closed higher at fresh records Monday, aided by a jump in oil prices and a pullback in the dollar, giving the Dow industrials, S&P 500 and Nasdaq their third simultaneous all-time closing highs this year.

The S&P 500 index SPX, -2.37% surged 16.28 points, or 0.8%, to close at a record 2,198.18, with its previous record reached on Aug. 15. Ten of the 11 main S&P 500 sectors finished in the green with energy leading gains, up 2.2%, and the materials sector gaining 1.3%. The real-estate sector was the only decliner, finishing down 0.2%.

The Dow Jones Industrial Average DJIA, -1.92% gained 88.76 points, or 0.5%, to close at a record 18,956.69, led by gains in DuPont DD, -2.49% , Apple Inc. AAPL, -4.19% and International Business Machines Corp. IBM, -1.39%

Read:Dow 19K? It’s been a slow march

The Nasdaq Composite Index COMP, -3.01% advanced 47.35 points, or 0.9%, to finish at 5,368.86, above its previous record of 5,339.52 set on Sept. 22.

The last time all three indexes closed at record highs at the same time was two sessions back in mid-August, and before then had not occurred since 1999.

The Russell 2000 index RUT, -3.04% finished at a record of 1,322.20, a gain of 6.56 points, or 0.5%. The index of small stocks outperformed its large-cap counterpart year to date, rising more than 16% since January, compared with 7.6% for the S&P 500.

See:‘Trump trade’ sparks stampede out of bond funds into stocks

Stronger oil prices and a moderation of dollar strength are providing relief for the market, along with a return to earnings growth, said Karyn Cavanaugh, senior market strategist at Voya Financial, in an interview. Additionally, with the market pricing in a December interest-rate increase from the Federal Reserve, positive economic data is becoming a tailwind for stocks.

“We’ve turned the corner and good news has gone back to being good news,” Cavanaugh said.

However, Maris Ogg, president at Tower Bridge Advisors, cautioned that people might be reading too much into President-elect Donald Trump’s future economic policies, which have been fueling the rally over the past two weeks.

“Stocks have rallied since the election on a lot of talk and no action so far, but it’s a classic jump to conclusions, that when coupled with high valuations, usually doesn’t end well,” Ogg said.

Since Election Day on Nov. 8, the Dow has climbed 3.4%, the S&P 500 has gained 2.7% and the Nasdaq has risen 3.4%.

A sharp rally in the dollar and 10-year Treasury yields last week dampened the post-election stock surge on Friday.

But on Monday, the dollar eased slightly, with the ICE Dollar Index DXY, +0.37% , which measures the currency against a basket of six currencies, down 0.3% to 100.90. The 10-year Treasury yield fell 3.4 basis points to 2.322%.

Bullish investors also welcomed comments from Federal Reserve Vice Chair Stanley Fischer, who said fiscal policy can do more to help the economy—and even lift interest rates.

Read: How Trump’s latest potential hires could send the stock market ‘through the roof’

“It is becoming clear that market participants have digested the Trump reality with most waiting for further news relating to Trump’s economic team, which could provide additional clarity on how he plans to lead the U.S. economy,” said Lukman Otunuga, FXTM research analyst, in a note.

See:Insights and market analysis on the election aftermath and policies of Donald Trump

A pause for reflection could come in a week when volume traditionally thins out as traders head out for the Thanksgiving Day holiday. Markets will shut Thursday and then close early on Black Friday, the traditional kickoff to holiday shopping.

Read:Investors to digest stock market feeding frenzy before their turkey

Economic docket: The Chicago Fed national activity index increased to -0.08 in October from -0.23 in September.

The bulk of the week’s economic indicators are expected Wednesday, including an update on durable-goods orders and the minutes of the latest Federal Open Market Committee meeting.

Read:Trump’s challenge: Get businesses to invest again

Stocks to watch:Symantec Corp. US:SYMC agreed to acquire LifeLock Inc. US:LOCK, a seller of identity-theft protection services, for $2.3 billion in cash, The Wall Street Journal reported, citing a source. Shares of LifeLock rallied nearly 15%, and Symantec shares closed up 3.2%.

The S&P 500’s biggest gainers were energy companies with shares of Marathon Petroleum Corp. MPC, -7.44% , Chesapeake Energy Corp. US:CHK, Range Resources Corp. RRC, +1.49% and Southwestern Energy Co. SWN, +0.39% all up 6% or more.

Wal-Mart Stores Inc. WMT, -1.67% said Monday that it will offer its Cyber Week sales several days early, starting Friday. Shares rose 1.2%.

Amazon.com Inc. AMZN, -4.12% shares rallied 2.6% as the holiday shopping season ramps up.

Facebook Inc. FB, -2.24% said it would hire an additional 500 employees in the U.K., according to media reports. Shares rose 4.1%.

Tyson Foods Inc. TSN, -3.87% dropped more than 14% after reporting disappointing results and announcing that Chief Executive Donnie Smith would leave. The meat producer offered a downbeat outlook for profit in the year ahead.

Australia’s Boral Ltd. BLD, +3.61% announced a $1.86 billion deal to acquire Utah-based building products companyHeadwaters Inc. US:HW. Boral said it wanted to increase exposure to “positive momentum” being seen by the U.S. industry, driven by hopes for more infrastructure spending by Trump. Headwaters shares jumped 17%.

SolarCity Corp. shares SCTY, +1.20% were halted from trading at $20.34 pending additional information request from Nasdaq.

Other markets:West Texas Intermediate crude-oil futures CLZ26, -1.14% for December rose 3.9% to settle at $47.49 a barrel. The rise in oil prices came after Russian President Vladimir Putin reportedly said Sunday that he was optimistic about a output-cut deal at the Organization of the Petroleum Exporting Countries meeting on Nov. 30. He also said his country was ready to freeze production if asked.

“While loose terms may be agreed, I remain skeptical that a full detailed agreement can be both achieved and carried out by OPEC given the clear differences that are so evident between certain key members,” said Craig Erlam, senior market analyst at OANDA, in a note to clients.

European stocks SXXP, +0.55% were largely flat, while Asian stocks ADOW, +0.08% finished mixed. Gold prices US:GCZ6 settled up 0.1% at $1,209.80 an ounce, while December copper US:HGZ6 rose nearly 5 cents, or 1.9%, to settle at just under $2.52 a pound.

—Barbara Kollmeyer in Madrid contributed to this article.