Portugal has agreed a three-year, 78-billion-euro ($116 billion) bailout with the European Union and IMF, caretaker Prime Minister Jose Socrates said on Tuesday.

Socrates' government collapsed last month, sparking a sharp rise in borrowing costs which forced Lisbon to seek a bailout -- the third euro zone country after Greece and Ireland to do so.

Socrates, who now faces a snap parliamentary election on June 5, hailed the package as a victory, saying it included more lenient terms than those imposed on Greece and Ireland.

The deal gave Portugal more time to meet budget goals which it had previously agreed to.

The government has obtained a good deal. This is a deal that defends Portugal, said Socrates, who had resisted a bailout for months.

Socrates provided few details of what terms the bailout included, saying only there are no financial assistance programs that are not demanding.

Filipe Garcia, head of Informacao de Mercados Financeiros consultants in Porto, said: He showed us the bright side of the moon, it is the dark side that remains to be seen, and that includes the interest rate.

Socrates said Portugal would now need to cut its budget deficit to 5.9 percent of gross domestic product this year, compared with a previous goal of 4.6 percent. The deficit will have to be cut to 4.5 percent in 2012 and 3 percent in 2013.

Some of the parameters look a little softer than expectations such as the higher deficit target and longer time line, said Vitaly Serebryakov, currency strategist at Wells Fargo in New York.

Officials from the European Commission, the International Monetary Fund and European Central Bank have been in Lisbon for almost a month to hammer out the agreement with Portugal.

We have reached staff-level agreement with the government on a comprehensive economic program that could be supported by the EC, the ECB and IMF, said European Commission spokesman Amadeu Altafaj in a statement.

Socrates said the agreement still has to be presented to opposition parties. Opposition Social Democrat leader Pedro Passos Coelho said earlier he was ready to meet the lenders.

We have said from the beginning that it is important that any programme should have broad cross-party support and will continue our engagement with the opposition parties to establish that this is the case, said Altafaj.

An EC source said what was presented was what had already been agreed. The source said the interest rate on the loan will be decided at a meeting of euro zone finance ministers in mid-May, when the bailout is expected to be approved.

Agreement is needed by June 15, when Portugal has to meet a bond redemption of 4.9 billion euros.

A new government after the June election will have to enact the terms of the bailout. Socrates said the loan agreement would not require any changes to the constitution.

(Additional Shrikesh Laxmidas and Sergio Goncalves; Editing by Louise Ireland)