By Anna Hirtenstein and Logan Moore

U.S. stocks finished higher Tuesday on optimism that Congress would reach an agreement on a spending package to support American households and businesses through the pandemic.

The S&P 500 added 0.5%, taking back some of its losses from earlier in the week. The broad-market index fell 1.6% Monday as investors grew concerned that lawmakers weren't making progress on a deal.

The Dow Jones Industrial Average, meanwhile, rose 0.4%. The tech-heavy Nasdaq Composite Index advanced 0.3%. All three major U.S. indexes were higher earlier in the session.

House Speaker Nancy Pelosi has indicated that the White House needs to reach a deal with Democrats by the end of Tuesday if the government wants to pass the next coronavirus-relief bill before Election Day. The California Democrat and Treasury Secretary Steven Mnuchin have edged closer on some policy differences recently, Mrs. Pelosi said Tuesday, but disputes remain.

"There has to be some form of a deal: the most likely outcome is that they'll have to do something. Given what's happening with Covid, the economy needs some support and markets need some form of guidance," said Peter Dixon, an economist at Commerzbank. But "we are really running out of time," he cautioned.

Markets have swung in recent weeks on every twist in the talks. If passed, the stimulus package could drive a further rally in stocks.

In bond markets, the yield on the benchmark 10-year U.S. Treasury note ticked up to 0.796%, from 0.760% on Monday.

Investors are also continuing to assess the elevated number of new coronavirus infections in the U.S. and Europe in recent weeks. Restrictions in some countries including the U.K. and France have been tightened, though most governments have avoided halting business activity completely, shielding the economy from the worst of the fallout.

"On the virus front, headlines are getting worse, but our base case is still that there won't be another full lockdown," said Fahad Kamal, chief investment officer at Kleinwort Hambros. "There's still a big difference between localized, targeted lockdowns and the shutdowns we had in March and April."

In economic data, permits for new construction in the U.S. were at 1.553 million in September, rising moderately compared with the previous month. The figures were slightly above economists' expectations, reflecting a continued recovery in the bedrock industry.

The rise in permits shines a bright light on the economy, said Michael Sheldon, chief investment officer at RDM Financial Group. He said this is in line with other housing data that has recently been released.

Other indicators to lookout for, he said, include the monthly leading economic index that will be released Thursday. This will give investors a clear view of what the next six to 12 months will look like.

In recent weeks, RDM has been trying to ignore the presidential election and focus on indicators like gross domestic product and employment.

"We often take the longer-term perspective," he said.

Lisa Erickson, head of traditional investment group at U.S. Bank Wealth Management, said the economy is showing a nice recovery so far from the pandemic, but an uptick in cases isn't helping.

In the longer term, Ms. Erickson said the election shouldn't have a big impact on the market.

"If you look at past presidential elections and if you look at scenarios with the incumbent keeping the seat, the return scenarios are the same over time," she said.

Meanwhile, earnings-reporting period continued for many companies.

Shares of consumer retail company Procter & Gamble rose 0.5% after it reported a surge in sales and raised its expectations for growth and plans for stock buybacks next year.

Fellow Dow component, property-casualty insurer Travelers, added 5.7% after reporting that its net income more than doubled in the third quarter.

IBM shares dropped 6.5% after it reported results after hours Monday which included a decline in revenue and no guidance.

Among other stock movers, shares of drugmaker Moderna rose 0.6% after it said its coronavirus vaccine could be authorized in December if it gets positive results next month from its clinical trial.

Technology firms Netflix and Snap, the developer of the Snapchat app, are expected to release earnings after the market closes.

Netflix in particular will be closely watched for indications of the extent to which tech companies are continuing to benefit from people spending more time at home during the pandemic, according to Mr. Kamal. The stock has been among the best performers this year, and has climbed over 60% so far.

Strong results from Netflix will "be the latest bit of validation on whether the enormous valuations that we're paying, do they make sense?" Mr. Kamal said. "It will be reflective of the stay-at-home trade in the wider sense, the trade that's been by far the winner over the course of this year."

Overseas, the pan-continental Stoxx Europe 600 fell 0.4%.

In European equities, Logitech rallied 16% after it posted a massive jump in sales from a spike in demand for computer equipment as more people worked from home.

UBS shares rose 4% after it said its net profit doubled from a surge in trading and it is setting aside billions for dividends and share buybacks.

China's Shanghai Composite Index advanced 0.5% by the close of trading, while Japan's Nikkei 225 retreated 0.4%.

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

(END) Dow Jones Newswires

10-20-20 1621ET