1 of 2
Michael Probst, Associated Press
A city broker is dressed as a shark on occasion of carnival at the stock market in Frankfurt, Germany, Tuesday, Feb. 21, 2012.

LONDON — Markets reacted cautiously Tuesday to the news that Greece finally secured its second massive bailout, which is aimed at giving the debt-ridden country the breathing room to enact economic reforms and set it back on the path to growth.

That is the optimistic hope in Europe's capitals, but many hurdles remain and the country is lumbered with massive debt even after its private creditors agreed to a huge writedown on their bondholdings. The view in the markets is that Greece remains insolvent and that its debt crisis still has a few more chapters to run.

"This deal clearly does not solve Greece's problems or that of the rest of the eurozone. What it does do is buy some time," said Louise Cooper, markets analyst at BGC Partners. "This deal does not rule out a breakup of the eurozone. It does not rule out a Greek default in the future, it does not prevent contagion and does not help the wider eurozone indebtedness problem."

After 12 hours of wrangling in Brussels, Greece's partners in the 17-country eurozone agreed to hand over another €130 billion ($170 billion) to the country in the hope it will avoid a potentially disastrous default as soon as next month, and secure the euro currency's future.

On top of the new rescue loans, Athens will also ask banks and other investment funds to forgive it some €107 billion ($142 billion) in debt, while the European Central Bank and national central banks in the eurozone will forgo profits on their holdings.

However, the pieces of the jigsaw have yet to be put in place and many in the markets think there will be more high-wire acts in the Greek debt drama.

Perhaps most important of all will be Greek elections, due in April, at a time when the country's economy is in freefall and unemployment is standing at a record rate above 20 percent. With the parties of the governing coalition struggling to get a combined 30 percent in opinion polls, there are fears that anti-bailout forces may win the election, or at least hold the balance of power.

"Greece now faces an austerity programme that, in the absence of a freely floating currency or the ability to ease monetary policy aggressively, will not only very likely exacerbate an already severe recession but may very well still leave it requiring an additional bailout in the years ahead," said Simon Derrick, an analyst at Bank of New York Mellon.

"This point will no doubt not be lost on politicians from New Democracy and PASOK as they watch their ratings slump and voters turn to the anti-bailout leftist parties ahead of the April election," Derrick added.

Over recent days, stocks have rallied in the hope that a deal would be secured and that Greece would avoid defaulting on its debts in a disorderly fashion that could hobble a tentative improvement in the global economy.

The eurozone and Greece had been under pressure to reach an accord quickly to prevent Athens from defaulting on a €14.5 billion ($19.2 billion) bond payment on March 20. An uncontrolled bankruptcy even of relatively small Greece could unleash market panic across the rest of the continent. That would further unsettle other struggling countries like Ireland, Portugal or the much bigger Italy or Spain.

Despite the promise of new rescue loans, which come on top of a €110 billion ($146 billion) bailout granted in 2010, the other 16 euro countries made clear that their trust in Greece is running low. Before Athens will see any new funds, it has to put into practice a whole range of previously promised cuts and reforms.

With the deal agreed, many investors took profits on the gains they have mustered over recent days.

In Europe, the FTSE 100 index of leading British shares was down 0.4 percent at 5,924 while the CAC-40 in France fell 0.6 percent to 3,453. Germany's DAX was 0.8 percent lower at 3,898.

The euro was faring slightly better, trading 0.2 percent higher on the day at $1.3230.

In the U.S., the Dow Jones industrial average was flat at 12,951 while the broader Standard & Poor's 500 index rose 0.1 percent to 1,363.

Earlier, Asian shares were mixed as they awaited the developments in Brussels.

Japan's Nikkei 225 index closed down 0.2 percent at 9,463.02 while Hong Kong's Hang Seng rose 0.3 percent to 21,478.72

In the oil markets, the attention was as much on Iran as on Greece. Earlier, Iran has laid out conditions for future oil exports to European countries after halting sales to Britain and France earlier this week.

Benchmark crude was up $1.31 to $104.91 a barrel in electronic trading on the New York Mercantile Exchange.

Pamela Sampson in Bangkok contributed to this report.