EU finance ministers have agreed new rules on how to wind up failed banks - the key pillar of a "banking union" designed to stop a repeat of the crisis.

The deal, finalised in Brussels late on Wednesday (18 December) after more than 12 hours of talks, makes good on earlier promises to reach a common position by the end of the year.

Student or retired? Then this plan is for you.

The new regime applies to all 17 eurozone countries, but allows non-euro states to sign up if they want.

Under the compromise, the banks themselves will put up the money to pay for closures of failed lenders via national levies which will be used to build up a €55 billion "single resolution fund" over the next 10 years.

The fund will be controlled by a new "resolution board" composed of a director, four appointed members and the representatives of national resolution authorities, who will assess what to do if a bank risks insolvency.

The negotiations wrestled with disagreement on which institution will have the final say on deciding to close a bank and how to pay for it.

The complicated decision-making process is to involve the European Central Bank, the European Commission and the new resolution board.

But finance ministers will have the final say on whether to take a bank into liquidation on the basis of a two-thirds majority in the EU Council.

EU single market commissioner Michel Barnier had earlier warned that a German-inspired proposal which formed the basis for discussions was "too complex" and slow moving.

"The complexity has been reduced in the last few hours," he told reporters after the meeting.

An EU official noted that the commission's role has been reduced to that of "a filter," with limited powers to table amendments and review resolution board recommendations.

Ministers also agreed that the new structures would be enshrined in an intergovernmental treaty to be finalised in March and then ratified at national level.

The intergovernmental approach was adopted at the behest of Germany to address concerns that its taxpayers would be made liable for bank failures in other countries.

Meanwhile, the new resolution fund will also be able to raise additional cash at national level or from the European Stability Mechanism (ESM), the eurozone's bailout fund, if there is insufficient money in the resolution fund to cover the costs of a bank failure.

Officials confirmed that the €500 billion ESM could be tapped under the same conditions as Spain's €41 billion bank rescue package, agreed in 2012.

For his part, German finance minister Wolfgang Schaueble describing the agreement as "a good basis to work on for next year."

The deal is the latest breakthrough on legislation aimed at preventing a repeat of the multi-billion euro bank bailouts paid for by taxpayers following the 2008-9 financial crisis.

Ministers and MEPs recently also agreed rules governing the hierarchy of creditors who would take losses if a bank got into difficulties and also signed off on a regime to guarantee the first €100,000 of individuals' savings.

Speaking with journalists following the conclusion of talks, Lithuanian finance minister Rimantas Sadzius, who chaired the meeting on behalf of its EU presidency, noted: "These regulations are as complicated as today's financial world."

Barnier said it is a "momentous" decision which would herald "a revolutionary change to Europe's financial sector."

He added that "great progress has been made in very little time."

Negotiations will now start with MEPs in the European Parliament, who agreed their own position on Tuesday.

Deputies want the commission to act as the resolution authority tasked with the official decision to initiate a resolution, leaving the board to decide on the details for its execution.

They also want the resolution fund to be able to raise loans from a “European public instrument," including monies from the European Stability Mechanism or the EU budget.