Euro zone officials agreed on Friday on the terms of a possible financial rescue for Greece as a ratings agency downgraded its debt by two notches citing a worsening economy and rising borrowing costs.

Deputy finance ministers and central bankers of the 16 countries sharing the European single currency decided that any emergency loans would be made on terms almost identical to standard International Monetary Fund bailouts if Greece needed them, an EU source said.

A deal has been reached, the source with close knowledge of the discussions told Reuters. It is almost a carbon copy of International Monetary Fund terms.

But the news brought only momentary relief to credit markets because Fitch Ratings cut Greece's credit rating to BBB-minus, its lowest investment-grade rating, and signaled further downgrades are possible.

Fitch also downgraded to BBB-minus the ratings of Greece's four largest banks -- the National Bank of Greece , Alpha Bank , Eurobank Ergasias and Piraeus Bank . It also cut the rating of the Agricultural Bank of Greece to BB-plus, or junk status.

All of those institutions, which still carry a negative ratings outlook, have experienced a 2-4 percent decline in the level of deposits as a result of the elevated risk perception surrounding Greece, Fitch said.

New figures published on Friday highlighted a deepening recession in Greece that will further aggravate its fiscal problems as the government continued to resist market pressure to seek outside help with its debt crisis.

After investors dumped Greek assets this week due to growing doubts over the euro zone/IMF rescue plan, the risk premium on Greek bonds briefly dipped below 400 basis points over benchmark German Bunds on news of the Brussels deal.

The euro gained 1 percent against the U.S. dollar.

EURO ZONE SUPPORT WON'T COME CHEAP

Euro zone officials, including the leaders of France and Italy, sought to reassure markets that the financial safety net agreed in principle at an EU summit last month, would be ready if it became needed.

We are ready to take action at any moment to come to the aid of Greece, French President Nicolas Sarkozy said after talks with Italian Prime Minister Silvio Berlusconi.

The EU source said that with the technical details of loans for Greece agreed upon, a decision on lending to Athens could now be made in a matter of hours.

A request for assistance from Athens would be analyzed by the European Commission and the European Central Bank and they would suggest the amount and maturity of the loans needed.

It would be a substantial amount I guess, something sufficient to shock the market, the source said.

Similarly, as in the case of Hungary, when they were given so much money that speculators actually got burned and Hungary didn't actually use that money, the source told Reuters.

It would then be up to a quick teleconference of euro zone finance ministers to give the green light to pay out the cash.

But the interest charged would still be high as EU sources have said Greece would have to pay more than 6 percent to get loans for up to three years and 100 basis points more for a longer-term loan.

According to the calculations we were given, given current yield curves, the equivalent of the EU formula would be well above 6 percent, because it has to have this element that it is non-subsidized and close to market, the EU source said.

A second source confirmed the rate would be more than 6 percent. Both noted the calculations were complex because they were based on a three-month Special Drawing Rights rate that needed to be converted to 3-year rates using swap rates.

The IMF charges 3.26 percent for loans to countries which borrow more than 300 percent of their quota, which would be the case for Greece as its quota is only $1.25 billion.

According to EU formula, the euro zone would charge also an extra 300 basis points on top and an additional 50 basis points service charge.

This would still be close to -- but below -- current market yields on Greek debt of 7.3 percent, according to Tradeweb data.

Yet some policymakers still believe the aid may not be needed.

The threat is not imminent because Greece seems to have enough money -- unless something nasty happens in the banking sector -- to refinance themselves for the next two months roughly. Or at least the next month, the EU source said.

Greek bank shares rose more than 7 percent on word of the euro zone deal after Thursday's 6 percent fall.

This reduces the country risk and investors have closed short positions in bank stocks, said Takis Zamanis, chief trader at Beta Securities.

However, news that Greek industrial output fell by 9.2 percent year-on-year in February while inflation spiked to 3.9 percent in March underscored the dire economic background to the fiscal crisis that has shaken confidence in the euro zone.

GOLDMAN SEES AID PROGRAM

The Greek economy is officially forecast to contract by 2.0 percent this year after a similar fall in 2009, but some economists now expect the decline to be even sharper.

That would make it harder to reach a promised budget deficit cut of four percentage points of gross domestic product this year and to sustain the fiscal adjustment over several years.

Finance Minister George Papaconstantinou earlier said bond spreads of more than 400 basis points over German bonds did not reflect the real state of the economy or the government's austerity measures.

Asked by reporters after meeting Prime Minister George Papandreou whether Greece wanted the aid plan activated, he said: No. This issue has not been raised ... we have said that Greece does not intend to use this mechanism.

However, financial markets are increasingly betting on an early resort to the rescue fund.

Geoffrey Yu, a currency strategist at UBS, said it could be days, rather than weeks before the IMF comes to Greece's aid.

Greece needs to borrow about 11 billion euros by the end of May to finance maturing debt and interest payments. Its overall borrowing requirement for this year is 53 billion euros.

The next test will come on Tuesday, when it will auction 1.2 billion euros in six- and 12-month T-bills, a government official said.

The euro zone source said that the bloc's finance ministers would issue a statement clarifying the terms of the aid for Greece at their meeting in Madrid on Friday, but could do that earlier should Greek yields surge on the market before then.

Goldman Sachs' Chief European economist Erik Nielsen said in a note issued Thursday he expected an 18-month aid program by the end of April worth 20-25 billion euros, co-financed by the euro zone and the IMF.