By Anna Hirtenstein and Karen Langley

U.S. stocks pulled back Tuesday after two sessions of solid gains as investors looked ahead to the first debate between President Trump and former Vice President Joe Biden.

The S&P 500 slipped 0.1%, while the Dow Jones Industrial Average edged down 0.1%, or about 30 points. The tech-heavy Nasdaq Composite hovered around the flatline.

Heading into the end of a turbulent September, major indexes edged up Thursday and then notched big gains Friday and Monday. The S&P 500 is up 3.6% in 2020 but down 4.4% for the month.

After stocks rocketed higher from their March lows, many investors predicted they could be due for a pullback.

"It's just the way markets work," said Vance Howard, chief executive and portfolio manager at Howard Capital Management. "It's kind of like a marathon runner. A marathon runner can only run so far and so fast without having to sit down and take a break. That doesn't mean anything is wrong with them."

Market volatility is on the rise as the November U.S. election gets closer. Mr. Trump and Mr. Biden will face off at 9 p.m. ET in Cleveland, Ohio, to discuss their respective records, the coronavirus pandemic, the economy, race and violence. Other issues are likely to be their views on mail-in voting, interference by overseas interests and potential election fraud.

"People will read into this debate for answers to questions about whether the results of the election will be accepted by either side," said Tony Dalwood, chief executive of Gresham House Asset Management. "If there's any uncertainty around this, that will lead to volatility."

Investors are also continuing to assess the now-dimming prospects for new additional spending to support the economy. House Democrats released a $2.2 trillion-bill for a coronavirus-relief package on Monday evening. House Speaker Nancy Pelosi spoke with Treasury Secretary Steven Mnuchin on Tuesday morning, aiming to revive stalled negotiations.

But the focus in Congress has turned to the selection of a new Supreme Court justice, analysts said.

"A combination of the situation with the Supreme Court, and Democrats being unwilling to hand Trump a major fiscal stimulus just before the election, makes it quite unlikely that we'll see something passed," said Sebastian Mackay, a multiasset fund manager at Invesco.

Sectors that led the S&P 500 higher Monday reversed course Tuesday, with the financials group dropping 0.8% and the energy group falling 2.6%. U.S. crude lost 3.2%, to $39.29 a barrel, and is down 36% this year.

Investors are continuing to monitor the spread of coronavirus. New cases in the U.S. edged down, while the global death toll from the pandemic surpassed one million.

Among individual stocks, shares of Abbott Laboratories rose 1.1% after Mr. Trump said 150 million rapid coronavirus tests from the pharmaceutical company would be shipped across the U.S.

Inovio Pharmaceuticals shares dropped 5.6% after a planned later-stage trial for a Covid-19 vaccine was put on hold, following questions from U.S. health regulators. The shares tumbled 28% Monday.

Overseas, the pan-continental Stoxx Europe 600 declined 0.5% as coronavirus cases continued to rise, raising the risk of more stringent measures being introduced by governments in the region.

In Asia, major stock benchmarks were mixed by the close of trading. The Shanghai Composite Index advanced 0.2% and Hong Kong's Hang Seng Index slipped 0.9%.

In bond markets, the yield on the 10-year Treasury fell to 0.650%, from 0.661% on Monday. Yields fall as bond prices rise.

Write to Anna Hirtenstein at anna.hirtenstein@wsj.com and Karen Langley at karen.langley@wsj.com