By Anna Hirtenstein

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 hovered around the flatline, while the Dow Jones Industrial Average edged down 0.2%, or about 58 points. The tech-heavy Nasdaq Composite ticked down less than 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.7% in 2020 but down 4.3% for the month.

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.6% after Mr. Trump said 150 million rapid coronavirus tests from the pharmaceutical company would be shipped across the U.S.

Overseas, the pan-continental Stoxx Europe 600 declined 0.2% 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.651%, from 0.661% on Monday.

Karen Langley contributed to this article.

Write to Anna Hirtenstein at anna.hirtenstein@wsj.com