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 before the presidential election.

The S&P 500 dropped 0.4%, while the Dow Jones Industrial Average fell 0.6%, or about 162 points. The tech-heavy Nasdaq Composite slipped 0.1%.

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.3% in 2020 but down 4.6% 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 was expected to speak to Treasury Secretary Steven Mnuchin on Tuesday morning. 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.

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

Molson Coors Beverage shares added 1.4% after the company said it entered into an exclusive agreement with Coca-Cola to make and sell Topo Chico Hard Seltzer in the U.S.

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.645%, 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