Image caption The prime minister made the televised statement flanked by his finance minister

Portugal's caretaker prime minister Jose Socrates says he has reached agreement on a bail-out from the EU and the International Monetary Fund.

In a televised statement, Mr Socrates said the three-year loan was a "good agreement that defends Portugal".

His office said Portugal would be asking for financial assistance worth 78bn euros ($116bn; £70bn).

The deal, which has been worked on for three weeks, now has to be endorsed by opposition parties.

The Social Democrats, the main opposition party, will study the agreement and decide whether to support it in the next 24 hours, a party official said.

"Later today or tomorrow morning the party will announce its position," said Carlos Moedas, who took part in the meeting with European officials and the IMF.

The crucial interest rate that Portugal will be charged will not be set until later this month.

But Mr Socrates said that under the terms of the deal, Portugal would be given more time to reach its budget deficit targets than had previously been expected.

The deficit will have to be cut to 5.9% of GDP this year, 4.5% in 2012 and 3% in 2013.

Portugal had previously aimed to reduce the deficit to 4.6% this year, 3% in 2012 and 2% in 2013.

In return for the loan, which includes 12 billion euros of support for the country's banks, Portugal has had to agree to a number of measures to increase tax revenue and reduce spending.

These include:

a cut in the public sector wage bill by freezing wages and limiting job promotion

an increase in sales tax on items such as cars and tobacco

the privatisation of stakes in national energy companies and the sale of national airline TAP Air Portugal

the reduction of the most generous state pensions and the freezing of others

the maximum length unemployment benefit can be paid to be cut to 18 months, from 3 years.

Austerity measures

Where will the growth come from that over the long term will take Portugal off the endangered list? While that question remains unanswered the talk of restructuring debt will not disappear. Read Gavin's blog in full

"I would like to announce to the Portuguese people that the government has reached agreement today with the representatives of international institutions on the programme of financial aid to our country," Mr Socrates said when he announced the deal on Tuesday.

Mr Socrates resigned as prime minister after failing to get austerity measures through parliament. There will be a general election on 5 June.

The deadline for the bail-out money to be in place is 15 June, when Portugal has to repay nearly 5bn euros of debt.

Portugal was the third eurozone country to have to ask for a bail-out, after Greece and the Irish Republic.

Its economy is expected to contract this year as a result of the latest set of austerity measures.

Portugal raised 1.12bn euros in an auction of 3-month Treasury bills on Wednesday - these are short-term loans from the markets. But it had to pay an interest rate of 4.65%, whereas two weeks ago it had paid 4.05%.

Unravelling rescue

BBC business editor Robert Peston says there are fears that Greece's rescue is unravelling and that the Portuguese bail-out will not be the eurozone's last.

In announcing this deal, Jose Socrates suggested that the terms of the bail-out were less severe than they had been for the Republic of Ireland and Greece. We can't know whether that's true until we see more details Read Stephanie's blog in full

"Just at the time that Portugal hopes loans from the EU and IMF will be enough to tide it over, investors are increasingly of the view that a similar rescue of Greece hasn't worked and that Greece will have to write off portions of its huge government borrowings," he says.

The great fear in the eurozone is that Portugal's bigger neighbour Spain will also need bailing out, which the EU may not be able to afford.

There are also challenges to Portugal's bail-out coming from Finland, where the bail-out has become a big issue in the formation of a new coalition government, following last month's elections.

EU rules require all member states to approve, or at least not oppose, bail-outs.

Prime Minister-elect Jyrki Katainen has said he will not be able to begin official talks on forming a government until 18 May, which is too late for Finland to be able to vote at the EU finance ministers meeting in Brussels on 16 May that would have to approve the bail-out package.

Mr Katainen said he might have to ask parliament to vote on whether to endorse the deal before a government is formed, which might pose difficulties because there was much support in the elections for parties that oppose bail-outs.