Portugal and Greece talked up the benefits of Lisbon's decision to accept a multi-billion euro bailout from the European Union and IMF on Wednesday, but the outlook for both countries and Ireland remains highly uncertain.

Portugal's caretaker Prime Minister Jose Socrates announced late on Tuesday he had reached preliminary agreement with the EU, IMF and the European Central Bank for a three-year package of support, including help for Lisbon's banks.

Portuguese government officials said the aid would total 78 billion euros, with 12 billion of that going to Portugal's banks. But a senior euro zone source said the range EU officials were working with was still 75-90 billion euros, depending on how much the banks ended up needing.

The figures are expected to be finalized in talks in the coming days, the source said.

The bailout means three of the euro zone's 17 countries are now effectively in financial intensive care -- Greece accepted 110 billion euros of bilateral loans a year ago and Ireland signed an 85 billion euro bailout last November -- with the long-term fiscal and economic prognosis for all three clouded.

Financial markets reacted cautiously but positively to the Portuguese deal, even though key details have yet to be formally announced, including the interest rate on the loans and the precise measures Lisbon must enact in exchange for aid.

Yields on Portuguese government debt fell, with the spread of 10-year government bond yields over German Bunds tightening by around 20 basis points to 675, an indication of lower risk, although it remains at extremely high levels.

Socrates, who is seeking re-election on June 5, said he had secured a good deal, although he added: There are no financial assistance programs that are not demanding.

Greece, which has raised the possibility of renegotiating elements of its package and which many analysts believe may be forced to restructure its debts despite its bailout, said the aid to Portugal should help settle financial markets.

This agreement will contribute to reducing uncertainties in the markets, which is something all of Europe needs, said government spokesman George Petalotis.

DIFFERING PLANS

But there were less positive noises about the package from other quarters, with Ireland concerned Lisbon may be getting a better deal than Dublin received five months ago.

Portugal's bailout must still be agreed by opposition parties and signed off by euro zone finance ministers at a meeting on May 16. There, Finland, where the anti-bailout True Finns party did well in an election last month, could throw a spanner in the works.

The euro zone has three patients on three different medicine regimes: Greece's loans must be repaid over seven years at an average interest rate of 4.2 percent, Ireland's over seven years at an average rate of 5.8 percent (although it is pushing to change the rate), and Portugal's will be finalized in days.

I think the terms inevitably are going to be different in each country because the circumstances are ... different, said Eamon Gilmore, Ireland's minister for foreign affairs.

The government would be very fed up too if another country was getting a bailout deal better than the terms that we are getting, he told state broadcaster RTE.

More than a year into the sovereign debt crisis, which at its peak threatened to tear the single European currency apart, EU leaders still find themselves battling to get on top of the problem, rather than bedding down reliable long-term solutions.

Many analysts still expect Greece, whose debts will climb to around 340 billion euros, or 150 percent of annual output, this year, to have to restructure its debts, either by writing off a portion of them or by rescheduling the repayments.

Such a decision could have widespread repercussions on major French and German banks and the European Central Bank, all of which own large amounts of Greek debt. Seventy percent of Greece's sovereign bonds are owned by foreign institutions.

Greece's finance minister has repeatedly dismissed the possibility of a debt restructuring, saying on Tuesday it would be a disaster for the country and its economy.

But there is a growing sense that Greece will not be able to avoid some form of restructuring, with its debt-to-GDP ratio increasing as the economy contracts and the cost of short-term loans unsustainable -- two-year yields stand at 25.7 percent.

Michael Meister, deputy parliamentary leader of German Chancellor Angela Merkel's Christian Democrats, said on Tuesday extending the repayment schedule on Greece's euro zone bailout loans made sense and European Central Bank policymaker Nout Wellink has said he is open to the idea of extending maturities on all Greek debt.

That might help Greece better weather its sovereign debt problems, but it would send reverberations through the rest of the euro zone economy, and immediately raise questions about whether Ireland and Portugal also need to restructure debts.

Portugal must roll over nearly 5 billion euros of debt on June 15. It is hoping that all the details of its bailout will be agreed by then so that it can carry out the refinancing.

Jonathan Loynes, chief European economist at Capital Economics in London, said Portugal's bailout should provide reassurance that Lisbon can meet its upcoming redemption, but added: It won't put an end to speculation that -- along with Greece and perhaps others -- it will sooner or later need to undertake some form of debt restructuring.

(With additional reporting by William James in London, Andrei Khalip and Axel Bugge in Lisbon, and George Georgiopoulos in Athens, editing by Mike Peacock)