By Anna Isaac and Alexander Osipovich

The Dow Jones Industrial Average rose more than 400 points Monday, clawing back some lost ground after four consecutive weeks of declines, as investors piled into economically sensitive stocks including those of banks and energy companies.

The day's gains were broad, with 27 of the 30 stocks in the blue-chip index rising, along with all 11 sectors of the S&P 500. The rally was a welcome relief for investors, who said last week's selloff was overdone.

JPMorgan Chase and Bank of America both rose more than 2.5%, while Chevron climbed nearly 3% as investors snapped up beaten-down stocks outside the high-flying technology sector.

"There's been a lot of froth in markets recently that has been washed out," said Hani Redha, a portfolio manager at PineBridge Investments, who said the economy is in the early stages of a multiyear expansion. "It will remain volatile in the coming weeks, but overall the trend will remain upward."

The Dow rose 410.10 points, or 1.5%, to 27584.06. The S&P 500 advanced 53.14 points, or 1.6%, to 3351.60, while the technology-heavy Nasdaq Composite climbed 203.96 points, or 1.9%, to 11117.53.

On the heels of Friday's rally, it marked the first time that the S&P 500 notched back-to-back gains of 1% or more since June.

The financial and energy sectors, which tend to be sensitive to economic trends, were the best-performing sectors of the S&P 500, both rising 2.3%.

Thomas Hayes, chairman of investment-management firm Great Hill Capital, said his firm had bought shares of Wells Fargo and other banks in recent days. He expects such stocks to fare better than the tech stocks that drove the market's rally from March to September.

"That's where you're going to outperform, with the things that have been left behind so far," he said. Cyclical stocks like banks tend to beat the broader market during recoveries from recessions, he added.

September has been a turbulent month for stocks, with declines in tech shares pulling down major indexes. Apple has dropped 11% since the start of the month, while Amazon.com has slumped 8% and electric-car maker Tesla has slid 15%.

Even so, such stocks have enjoyed an extraordinary run-up this year, thanks to profits that have remained resilient during the coronavirus pandemic and a sense that Big Tech will benefit as more Americans continue working from home. Apple is up 57% for the year, while Amazon is up 72%. Tesla's stock has quintupled in 2020.

Markets have been turbulent in recent weeks due to investors' concerns about rising or elevated levels of coronavirus infections, the uneven pace of economic recovery, political risks and tensions between Beijing and Washington.

Traders are betting on one of the most volatile U.S. election seasons on record, wagering on unusually large swings in everything from stocks to currencies. Investors are scooping up a variety of investments that would pay out if volatility extends far beyond Election Day, concerned that the outcome of the presidential contest could remain unclear into December.

"It's a very different environment than that we've seen for any other election," said James McCormick, a strategist at NatWest Markets. "As an investor, you have to protect yourself because you just don't know how this is going to swing."

In corporate news, Devon Energy jumped 98 cents, or 11%, to $9.80 after The Wall Street Journal reported and the company later confirmed a merger agreement with WPX Energy. The move could help the two companies weather a prolonged industry slump. WPX's stock rallied 73 cents, or 16%, to $5.17.

Uber shares rose $1.10, or 3.2%, to $35.56 after the ride-hailing company won an appeal over the revocation of its operating license in London, ending for now a yearslong tussle with regulators in one of its biggest global markets.

Overseas, the pan-continental Stoxx Europe 600 rose 2.2%. In Asia, most major benchmarks climbed. Japan's Nikkei 225 Index rose 1.3%, while Hong Kong's Hang Seng rose 1%.

In bond markets, the yield on the benchmark 10-year Treasury note inched up to 0.663%, from 0.659% Friday.

Futures on Brent crude, the global oil benchmark, rose 1.2% to settle at $42.43.

Write to Anna Isaac at anna.isaac@wsj.com and Alexander Osipovich at alexander.osipovich@dowjones.com