Stocks closed broadly higher Tuesday as Wall Street welcomed a batch of solid earnings reports from U.S. companies.

The S&P 500 gained 0.5%, recouping some of its loss from a day earlier. Technology, communication and financial stocks powered most of the gains, while household goods makers fell. Overseas markets closed mixed. Treasury yields held steady.

Traders bid up shares in several companies that reported quarterly results that were better than analysts expected, including Procter & Gamble, Regions Financial, Albertsons and Travelers. Others didn’t fare as well. Netflix shares fell in after-hours trading after the streaming service reported third-quarter earnings and a tally of new subscribers that fell short of analysts' expectations.

Investors also had their eye on Washington in hopes that Democrats and Republicans will reach a deal to deliver more aid for the economy. Fading optimism that an agreement on a new relief package will be reached before the election next month led to a late-afternoon sell-off on Monday.

“We have had a decently strong recovery out of the gate, but there are signs that it is maybe starting to slow,” said Charlie Ripley, senior investment strategist for Allianz Investment Management. “Additional stimulus aid is something that will benefit the economy.”

Shares in Google’s parent company rose following news that the Justice Department sued the internet giant Tuesday, claiming Google has abused its dominance in online search and advertising to stifle competition and harm consumers.

The market had been on track for a stronger finish, before losing some of its gains by the final hour of trading. The S&P 500 rose 16.20 points to 3,443.12. The Dow Jones Industrial Average of big blue chips gained 113.37 points, or 0.4%, to 28,308.79. It had been up 379 points.

The Nasdaq composite snapped a five-day losing streak, rising 37.61 points, or 0.3%, to 11,516.49.

Stocks have been mostly pushing higher this month after giving back some of their big gains this year in a sudden September swoon. The benchmark S&P 500 has notched a gain in each of the past three weeks. Even so, trading often has been choppy from one day to the next, reflecting uncertainty over the timing of more stimulus for the economy, something investors have been hoping for since July, when a supplemental $600-a-week unemployment benefit package ran out.

“If we can’t get stimulus within the next three or four months, that’s going to be damaging to the U.S. economy,” said Megan Horneman, director of portfolio strategy at Verdence Capital Advisors.

Senate Majority Leader Mitch McConnell said Tuesday that he’ll schedule a vote if House Speaker Nancy Pelosi and the Trump administration are able to seal an agreement on a huge COVID-19 relief bill. Pelosi and Treasury Secretary Steven Mnuchin held talks for the second day in a row Tuesday.

On Sunday, Pelosi said that Tuesday would be the deadline for reaching a pre-election deal with the Trump administration on a new coronavirus relief package. But she clarified in an interview with Bloomberg News Tuesday that the aim is to spur the two sides to exchange their best proposals on a host of unresolved issues, not to close out all of their disagreements or have final legislative language at hand.

Google parent Alphabet rose 1.4% after the Justice Department sued the company for antitrust violations. The lawsuit could be an opening salvo ahead of other major government antitrust actions, given ongoing federal probes of other major tech companies, including Apple, Amazon and Facebook. Shares in Apple gained 1.5%, while Amazon added 0.3%. Facebook rose 2.4%.

The Big Tech stocks have been investor favorites this year, because the companies are expected to do well during and after the pandemic. That these companies could one day face the risk of an antitrust case is a risk investors have, or should have, long considered.

“It doesn’t look like the market is too worried about it right now,” Horneman said, adding that the stocks' market-leading gains this year suggest traders are not pricing in a major regulatory risk.

Homebuilders rose broadly after the Commerce Department said U.S. home construction rose a solid 1.9% last month after having fallen in August. Applications for building permits, a good sign of future activity, also rose in September. NVR was the biggest gainer, climbing 3.5%.

Procter & Gamble rose 0.4% after the consumer products company reported solid fiscal first-quarter results and raised its earnings outlook. Insurer the Travelers Cos. gained 5.6% after its latest earnings topped Wall Street’s estimates, thanks partly to lower-than-expected losses on claims.

Albertsons climbed 5.8% following its latest quarterly results. The supermarket chain benefited from a sharp increase in online and in-store sales as customers continue to stock up on groceries due to the coronavirus. Regions Financial gained 4.9% as traders cheered the bank’s latest quarterly results, which included solid fee income from mortgages.

Across the S&P 500, analysts are expecting companies to report another drop in profits for the summer from year-ago levels. But they’re forecasting the decline to moderate from the nearly 32% plunge from the spring as the economy has shown signs of improvement.

The yield on the 10-year Treasury note rose to 0.79 from 0.78% late Monday.