Stocks rallied in afternoon trading on Wall Street Monday, following seven weeks of declines that nearly ended the bull market that began in March 2020.

The S&P 500 rose 1.8% as of 3:12 p.m. Eastern. The Dow Jones Industrial Average rose 588 points, or 1.9%, to 31,850, and the Nasdaq rose 1.3%.

Banks made strong gains along with rising bond yields, which they rely on to charge more lucrative interest on loans. The yield on the 10-year Treasury rose to 2.86% from 2.77% late Friday. Bank of America rose 6.3%.

Technology stocks also did some heavy lifting. Apple rose 3.4% and Microsoft rose 2.7%. The sector has been choppy over the last few weeks and has prompted many of the market’s recent big swings.

VMware surged 20.8% following a report that chipmaker Broadcom is offering to buy the cloud-computing company. JPMorgan Chase jumped 6.9% after giving investors an encouraging update on its financial forecasts.

Retailers and some other companies that rely on direct consumer spending lagged the rest of the market. Amazon fell 0.7%. A series of disappointing earnings reports from key retailers last week raised concerns that consumers are tempering spending on a wide range of goods as they get squeezed by rising inflation.

Lingering concerns about inflation have been weighing on the market and have kept major indexes in a slump. The benchmark S&P 500 is so far experiencing its longest weekly losing streak since the dot-com bubble was deflating in 2001. It came close to falling 20% from its peak earlier this year, which would put the index at the heart of most workers’ 401(k) accounts into a bear market.

Inflation’s impact on consumers and businesses has been the key worry for markets, along with the Federal Reserve’s attempt to temper that impact by aggressively raising interest rates. Inflation brought on by a big supply and demand disconnect has worsened because of Russia’s invasion of Ukraine and its impact on energy prices.

Supply chains were further hurt by China’s recent series of lockdowns for several major cities facing rising COVID-19 cases.

Investors are worried that the central bank could go too far in raising rates or move too quickly, which could stunt economic growth and potentially bring on a recession. On Wednesday, investors will get a more detailed glimpse into the Fed’s decision-making process with the release of minutes from the latest policy-setting meeting.

Wall Street will also get a few economic updates this week from the Commerce Department. On Thursday, it will release a report on first-quarter gross domestic product, and on Friday, it will release data on personal income and spending for April.