Oil and gas stocks were among the biggest gainers as the price of crude rose. Traders also bid up shares in defense contractors, while travel-related stocks slumped.
The gains followed a mixed day in European markets, which shook off an early loss and ended mixed.
All told, the Dow Jones industrial average rose 237.77 points, or 1.4 percent, to 17,483.01. The Standard & Poor’s 500 index gained 30.15 points, or 1.5 percent, to 2,053.19. The Nasdaq composite added 56.73 points, or 1.2 percent, to 4,984.62.
Monday’s rally helped lift the market following its biggest weekly loss since August.
The New York Stock Exchange had a moment of silence before regular trading.
The major market indexes started lower but rebounded within the first 10 minutes as investors piled into consumer staples stocks, a category that includes Coca-Cola and household products maker Procter & Gamble. Stocks wavered for a while, but began to climb steadily by midday as crude oil prices perked up, pushing up energy stocks.
The energy sector in the S&P 500 surged 3.3 percent, far more than the rest of the market.
Natural gas and coal producer Consol Energy added 56 cents, or 7.6 percent, to $7.96. Cabot Oil & Gas gained $1.82, or 8.8 percent, to $22.56, while Range Resources rose $2.90, or 9.1 percent, to $34.62.
The energy sector has been the biggest laggard among industries this year, down 14.9 percent, as the slide in oil prices has deepened.
Benchmark U.S. crude oil climbed $1, or 2.5 percent, to close at $41.74 a barrel in New York. Brent crude, used to price international oils, rose 9 cents, or 0.2 percent, to close at $44.56 a barrel in London.
News that Marriott International agreed to acquire rival hotel chain Starwood for $12.2 billion received a mixed response. Marriott added 98 cents, or 1.3 percent, to $73.72, while Starwood slid $2.72, or 3.6 percent, to $72.27.
The prospects of stepped-up military action to counteract terror threats helped give defense contractors a boost.
Northrop Grumman gained $7.79, or 4.4 percent, to $186.61, while Lockheed Martin added $7.51, or 3.5 percent, to $220.67. Raytheon rose $4.86, or 4.1 percent, to $121.11.
At the same time, traders moved to unload some travel-related stocks.
In Europe, Germany’s DAX was flat, while France’s CAC-40 slipped 0.1 percent. Britain’s FTSE 100 rose 0.5 percent. In Asia, Japan’s Nikkei 225 fell nearly 1 percent, while Australia’s S&P/ASX 200 lost nearly 1 percent. Hong Kong’s Hang Seng fell 1.7 percent.
In other energy futures trading, wholesale gasoline was little changed at $1.239 a gallon, heating oil rose 0.4 cent to $1.385 a gallon and natural gas rose 2.4 cents to $2.385 per 1,000 cubic feet.
Precious and industrial metals prices closed mixed. Gold rose $2.70 to $1,083.60 an ounce, silver fell two cents to $14.22 an ounce and copper gave up five cents to close at $2.12 a pound.
U.S. government bond prices rose. The yield on the 10-year Treasury note fell to 2.27 percent from 2.28 percent late Friday. The dollar rose to 123.21 yen from 122.72 yen and the euro fell to $1.0687 from $1.0740.