The ministers also agreed to push out the €40bn EU bailout loan for another seven years to help spread more evenly repayments of the country’s massive debt.

Department of Finance officials said yesterday it “was one of the better days in our programme” as the finance ministers met in Dublin Castle.

They agreed to urgently move forward the banking union that would see the EU’s rescue fund, the ESM, recapitalise troubled banks and put a system in place to wind up others.

For the first time, EU ministers accepted Ireland’s situation is different to other bailed-out countries, and that the money put into the banks should be recognised, said a senior EU official.

“They wanted to bail in senior bondholders and were not let and now we have done a bail-in for Cyprus — this is tough for them,” said the official, adding the ministers will examine Ireland’s specific circumstances before July.

Jeroen Dijsselbloem, the head of the eurogroup of ministers said: “There is a distinction between legacy and retroactive... We have made progress and there will be a more final discussion in June.”

A Department of Finance official said that getting EU finance ministers to agree to make a difference between retroactive repayments, and legacy assets — which means old debt waiting to be funded by the EU funds, “was a huge win for us”.

This could mean ownership of AIB and Permanent TSB, together with the shares the State owns in Bank of Ireland, moving to the ESM.

Finance Minister Michael Noonan, who is hosting the two-day meeting, welcomed the decision to extend the maturities on the bailout loans by seven years.

“It is particularly important, as it will increase the ability of our banks, semi- states and large companies to raise capital at lower cost on the financial markets and will have a consequent benefit across the whole Irish economy,” he said.

The current average repayment time for the EU bailout funds is 12.5 years.

The new deal will see the schedule pushed out to an average of close to 20 years. While it will also mean a saving for the State, it will reduce pressure on taxpayers and improve the country’s cash flow.

Portugal has won a similar deal — provided it fills a budget gap of €1.5bn over the next month. Portuguese finance minister Vitor Gaspar conceded it would have been better to get a 10-year extension but the troika warned there could be new conditions attached.

While there were some fears that the German parliament might object, Berlin expect to pass this, together with the €10bn bailout for Cyprus in the coming weeks before their general election.