* Shares rise, oil gains after Cyprus gets bailout
* But Cyprus deal could set precedent within euro zone
* Euro retreats after initial gains to Cyprus deal
* U.S. Treasury bond prices fall
By Herbert Lash
NEW YORK, March 25 (Reuters) - Global equity markets and oil prices rose on Monday after Cyprus agreed to a painful bailout that will avert a collapse of its banking system and keep the country within the euro zone.
Cypriot policy-makers reached an eleventh-hour deal with the European Union, the European Central Bank and the International Monetary Fund to shut down its second largest bank in return for 10 billion euro ($13 billion).
The bailout brought immediate relief to investors who had feared Cyprus might default. But the deal will inflict heavy losses on depositors, including wealthy Russians, on deposits of more than 100,000 euros, which are not guaranteed under EU law.
Wall Street opened higher, following gains in European equity markets, in a relief rally that a financial meltdown had been averted in Europe. Safe-haven assets such as U.S. Treasuries and gold prices fell.
"The problems in Cyprus had held the market back a little bit, so I guess there will be some relief. This takes away one of the hurdles for moving higher," said Rick Meckler, president of hedge fund LibertyView Capital Management in Jersey City, New Jersey.
The Dow Jones industrial average was up 31.41 points, or 0.21 percent, at 14,542.36. The Standard & Poor's 500 Index was up 6.08 points, or 0.39 percent, at 1,562.97. The Nasdaq Composite Index was up 10.49 points, or 0.32 percent, at 3,255.49.
The pan-European FTSEurofirst 300 index of leading regional shares pared some gains to trade 0.61 percent higher at 1196.75.
MSCI's all-country world equity index rose 0.43 percent to 360.29.
Oil also joined in the rally in risk assets. Brent crude rose 89 cents to above $108.55 a barrel as hopes that the avoidance of a more severe outcome in Cyprus could brighten the outlook for a revival in demand.
U.S. light sweet crude oil rose $1.21 to $94.92 a barrel.
But the euro and German Bund futures retreated after initial gains as concerns emerged about the implications of the deal.
The Cyprus deal was unlike previous peripheral euro zone country bailouts, which have protected bank deposits.
"The critical issue remains that of precedent for larger Eurozone countries, and the way in which the Cyprus situation has been managed does not seem to inspire a great deal of confidence," said Ilya Spivak, a currency strategist at DailyFX in New York.
Traders in Europe said there were already second thoughts on the deal.
"The loss of confidence in the European banking system stemming from the Cypriot crisis will not only weigh on the banks but also on the economy of the region," added a Paris-based trader.
"The market is beginning to wake up to what's going on in Europe," said Ronnie Chopra, a strategist at TradeNext.
The euro fell as low as $1.2916 and last traded at $1.2931, down 0.4 percent on the day, according to Reuters data.
German Bund futures were up 1 ticks on the day at 144.38, having fallen as low as 143.91.
The benchmark 10-year U.S. Treasury note was down 6/32 in price to yield 1.9458 percent.