NEW YORK (Reuters) - U.S. stocks surged on Monday after senators in Washington reached a deal to reopen the federal government, ending a 2-1/2-day shutdown that world markets largely took in stride.

U.S. stocks jumped to session highs after reports that the Senate had struck an agreement to keep the government funded until Feb. 8.

The Dow Jones Industrial Average .DJI rose 142.88 points, or 0.55 percent, to 26,214.6, the S&P 500 .SPX gained 22.67 points, or 0.81 percent, to 2,832.97, and the Nasdaq Composite .IXIC added 71.65 points, or 0.98 percent, to 7,408.03.

“It’s had very little lasting effects on the market in the past. I think this is just another incidence of that occurring,” Bruce Zaro, chief technical strategist at Bolton Global Asset Management in Boston, said of the government shutdown, which began Friday at midnight.

U.S. Treasury yields, which tended to fall during previous government shutdowns, rose as investors saw limited economic fallout from the political standoff and focused instead on a global economy motoring ahead and U.S. inflation pressures.

World markets were unfazed by the shutdown earlier in the day. The benchmark U.S. 10-year Treasury yield US10YT=RR on Monday closed at its highest level in more than three years, an extension of the selloff in U.S. bonds since September.

The rise in U.S. shares followed broad gains in Europe, where markets focused on a flurry of mergers and acquisitions and upcoming corporate earnings reports. Progress toward an end to political deadlock in Germany helped the mood.

Slideshow ( 2 images )

The pan-European STOXX 600 .STOXX index was up 0.3 percent, with major indexes rising in France and Germany. The UK's FTSE .FTSE was the main exception, dropping 0.2 percent.

The MSCI world equity index .MIWD00000PUS, which tracks shares in 47 countries, rose 0.4 percent.

DOLLAR NEAR THREE-YEAR LOW

The dollar remained stuck near three-year lows, continuing its weak start to the year. The dollar index .DXY fell 0.2 percent, with the euro EUR= up 0.3 percent to $1.2257.

In European bond markets, Spain's borrowing costs ES10YT=TWEB dropped to a six-week low and the gap over its German peers DE10YT=TWEB fell to its tightest in almost three years after Fitch Ratings gave Spain its first "A" rating since the euro zone debt crisis.

Greece's short-dated yields GR2YT=TWEBGR5YT=TWEB also fell after S&P Global Ratings upgraded the country's credit ratings for the first time in two years.

Most other euro zone bond yields were little changed. Analysts said investors were probably moving to the sidelines before the European Central Bank’s first meeting of 2018 this Thursday.

Oil prices rose near three-year highs, with U.S. crude CLcv1 rose 0.84 percent to $63.84 per barrel and Brent LCOcv1 at $69.26, up 0.95 percent on the day.

Spot gold XAU= added 0.2 percent to $1,334.34 an ounce. U.S. gold futures GCcv1 gained 0.05 percent to $1,333.80 an ounce.