By Luke Baker

BRUSSELS (Reuters) - Portugal and Greece talked up the benefits of Lisbon's decision to accept a 78-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.

The decision 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 most 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 points, an indication of lower risk, although it remains at extremely high levels.

Socrates, who is seeking re-election at elections 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 the 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 -- which must still be agreed by Portugal's opposition parties and signed off by euro zone finance ministers on May 16 -- from other quarters, with Ireland concerned Lisbon may be getting a better deal than Dublin received five months ago.

The euro zone has three patients on three different health plans: 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 disastrous mistake for the country and its economy.

"We would stay out of markets for 10-15 years, the wealth of the Greek pension funds would suffer writedowns, we would have problems in the banking system and hence the real economy," George Papaconstantinou said.

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 there was sense in extending the repayment schedule on Greece's euro zone bailout loans, 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."

As well as securing opposition parties' support for the package, a major hurdle will be getting euro zone finance ministers' approval.

Finland, where the anti-bailout True Finns party did well in an election last month, could throw a spanner in the works.

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