EU ministers tonight spelt out the terms of Ireland's €85bn international financial rescue package, and revealed the Dublin government will have to raid its national pension fund and other cash reserves for €17.5bn as a condition of the deal to bail out its banks and debt-laden economy.

The unexpected contribution from Ireland was demanded at a hastily arranged meeting of the eurozone's finance ministers, who were desperate to secure a deal before the markets open tomorrow.

The package from the EU and International Monetary Fund includes €67.5bn of external loans. €10bn will go straight to the crippled banks, and €25bn is earmarked for bank support in the future. The remaining €50bn will be used to shore up the public finances and allow the government to keep making welfare payments and cover other expenses such as health and education.

The agreement was outlined after six hours of parallel emergency meetings in Brussels of all 27 EU finance ministers and of the 16 countries using the single currency. New proposals for a permanent crisis mechanism to shore up the euro from 2013, when the current schemes run out, were also outlined.

The gravity of the situation was such that the chancellor, George Osborne, attended the eurozone meeting, even though the UK is not in the single currency. The UK is to contribute an estimated €7bn, some €3.8bn in a direct loan for the banks.

Osborne said: "There is a loan going from Britain to Ireland of just over £3bn. Of course, Britain is also part of the EU and part of the IMF, so we stand behind their loans as well. It is in Britain's national interest. It is money we fully expect to get back, and we think it will help Ireland get on a fully stable path back to growth."

He also negotiated that the UK would not be part of any future eurozone bailout schemes after 2013.

Within minutes of the announcement, Ireland's embattled prime minster, Brian Cowen, was facing questions about whether his country could afford the interest on the loans, which will average 5.8%, as the repayments will amount to 20% of annual tax revenue. But he was unrepentant. "Can Ireland do without this package? The answer to that is no," he told reporters last night.

"If we don't have this programme we would have to go back to the market, which has prohibitive rates," he said.

Ireland's borrowing costs have shot through 9% and anxiety about the terms of Ireland's bail-out package has reverberated through the eurozone. There have been sharp rises in the borrowing costs of Portugal and Spain, sparking fears that they too will need assistance to avoid a break-up of the eurozone.

Joan Burton, of the Irish Labour party, said that the Europeans and IMF had "played better poker" than Ireland. She claimed that the Irish government had gambled away assets such as the pension reserve fund in the discussions. "The EU and IMF have us where they want us," she said.

EU leaders wanted to demonstrate to the markets that they could contain the contagion in the eurozone, and for the first time today called for the financial markets to bear some of the losses in future European sovereign debt crises.

Cowen made it clear that the authorities were trying to stop another crisis that would have been caused if bond holders had been forced to take losses. Such a move, he said, could have endangered the "entire financial system".

Dublin insisted the interest rates on the loans had to be less than 6%, even though this is more than the 5.2% paid by Greece when it was bailed out in April. While agreeing the Irish deal, the leaders of Germany, France, and the European Central Bank issued demands that the private sector should shoulder some of the losses in future bailouts after 2013.

This issue of creditor "haircuts", or investor losses, has been highly contentious over the past month.

Chancellor Angela Merkel of Germany, President Nicolas Sarkozy of France, and the ECB chief, Jean-Claude Trichet, conferred over the weekend on the plan for a permanent euro rescue system. According to German officials today, Berlin has scaled back its demands after running into resistance from the French and the ECB. The paper tabled today, to be discussed at an EU summit next month, rowed back from a blanket insistence on creditor haircuts, instead saying the investor losses should be treated on a case by case basis.

Cost of the bailout

• The €85bn bailout is made up of €67.5bn from the European Union, the International Monetary Fund, and the states of Denmark, Sweden and the UK. Another €17.5bn comes from Ireland's cash reserves and its national pension reserve fund.

•Of this, €35bn is set aside to shore up the Irish banking system. €10bn will be used immediately, and the other €25bn is a contingency fund.

• Of the €67.5bn, the IMF is putting up €22.5bn.

• The two European stability funds are also putting in €22.5bn each. The UK contributes to one of these funds.

• The UK's contribution is €3.8bn as a direct loan to the Irish banks. The interest rate has yet to be announced, but will be about 6%. The UK taxpayer will contribute about the same amount again through its membership of the IMF and EU bailout schemes.

• The plan allows Ireland to delay the deadline set for reducing its budget deficit to 3% of GDP until 2015, a year longer than previously. The deficit is currently 32%.

• The interest rate on all the loans, if they were all held for the maximum term, averages 5.8%. The bailout offered to Greece earlier this year averaged some 5.2%. The bond market had been demanding 9% to lend cash to Ireland in recent weeks.

• The Irish government has said that interest payments on its state debt will total more than 20% of tax revenues in 2014.