NEW YORK (Reuters) - Global stocks rallied on Monday, backed by a rise in oil and commodity prices, while the British pound suffered its biggest one-day loss in nearly six years against the dollar on fears Britain would leave the European Union.

A trader works on the floor of the New York Stock Exchange in the Manhattan borough of New York, February 22, 2016. REUTERS/Carlo Allegri

Sterling tumbled to a near seven-year low during the session after popular London Mayor Boris Johnson said he would campaign to leave the EU ahead of a June 23 referendum. The euro fell 0.9 percent.

Battered oil prices jumped as speculation about falling U.S. shale output helped feed the notion that crude prices may be bottoming after their 20-month collapse.

Benchmark Brent LCOc1 settled up 5.1 percent to $34.69 a barrel, while U.S. crude settled up 6.2 percent at $31.48 a barrel.

Stocks, whose performance has been tightly linked to oil prices, posted solid gains across major markets.

“It still seems like oil, for whatever reason, continues to be what everything is trading off of,” said Eric Kuby, chief investment officer at North Star Investment Management Corp in Chicago. “That’s the signal that the world is OK, that oil prices are going up.”

The Dow Jones industrial average .DJI rose 228.67 points, or 1.39 percent, to 16,620.66, the S&P 500 .SPX gained 27.72 points, or 1.45 percent, to 1,945.5 and the Nasdaq Composite .IXIC added 66.18 points, or 1.47 percent, to 4,570.61.

All 10 major S&P sectors were higher, led by a 2.2 percent increase for the energy .SPNY sector.

The gains built on last week’s strong performance after a poor overall start for U.S. equities in 2016.

“The fact that we held it on Friday and then went through a weekend and sustained and advanced it even more, I think is building optimism and maybe we’ve turned a corner,” said Jim Paulsen, chief investment officer at Wells Capital Management in Minneapolis.

The pan-European FTSEurofirst 300 share index .FTEU3 rose 1.7 percent. Mining stocks were among the best performers, with Anglo American AAL.L rising 10.8 percent, as the price of copper CMCU3 reached a two-week high.

Helped by mining shares, Britain's FTSE 100 index .FTSE rose 1.5 percent, despite concerns over a possible EU exit.

Stocks shrugged off a survey showing private sector business activity in the euro zone increased at its weakest pace in more than a year in February.

MSCI's index of world shares .MIWD00000PUS rose 1.3 percent.

Worries about a possible British exit from the EU sent the euro to a near three-week low. Sterling fell 1.8 percent against the greenback and dropped as low as $1.4057.

“A Brexit would be bad for sterling, but it would also be bad for the euro,” said Neil Jones, Mizuho’s head of hedge fund sales in London.

The dollar was up 0.8 percent against a basket of six currencies .DXY.

U.S. Treasury prices ended lower as rising stock and oil prices reduced demand for safe haven debt.

Benchmark 10-year notes US10YT=RR fell 5/32 in price to yield 1.77 percent, up from 1.75 percent late Friday.

Zinc prices CMZN3 surged to a four-month peak and other base metals also gained as investors' appetite for risk increased while they also worried about potential shortages.

Gold XAU= fell 1.7 percent as the dollar strengthened and investor appetite for risk increased.