Negotiations end in agreement on who should bear the brunt of losses caused by banking failure

The European Union has struck a deal on rules establishing who will pay for future bank bailouts without taxpayers having to foot the bill.

The agreement reached by the EU's 27 finance ministers after seven hours of negotiations early on Thursday is an important step toward establishing Europe's so-called banking union with the goal of restoring financial and economic stability to the recession-hit bloc.

The set of rules determines the order in which investors and creditors will have to take losses when a bank is restructured or shut down, with a taxpayer-funded bailout being only a limited last resort.

"That's a major shift from the public means, from the taxpayer if you will, back to the financial sector itself which will now become for a very, very large extent responsible for dealing with its own problems," said the Dutch finance minister, Jeroen Dijsselbloem.

The ministers had failed to reach a deal in 19 hours of continuous talks last week, and their latest round of negotiations in Brussels came only hours before a summit of the EU's 27 heads of state and government. At the summit, the EU leaders are expected to take stock of the progress of the bloc's financial and economic policies.

Exactly a year ago, EU leaders pledged to tackle the eurozone's financial crisis by introducing a banking union, which aims to give the supervision and rescue of banks to European institutions rather than leaving weaker member states to fend for themselves.

Since its announcement the project has stalled on many fronts, not least because richer countries fear they might have to pay for the banking woes of weaker countries. But Thursday's breakthrough gave the project new credibility by establishing clear rules.

"The talks were lengthy, quite difficult and intense," Germay's finance minister Wolfgang Schaeuble said. "This is an important step. We make progress step by step" towards completing the banking union.

The EU governments will now start negotiating the legislation with the European parliament.

After the 2008-09 financial crisis, countries such as Ireland, Britain and Germany had to pump dozens of billions of pounds and euros in fresh capital into ailing banks to prevent the financial system collapsing.

To avoid that happening again, finance ministers discussed who should contribute in which order so that ordinary taxpayers are not left with the bill.

"Bail-in is now the rule," Ireland's finance minister, Michael Noonan, said. The rules put an end to moral hazard by making it clear that banks would suffer before the government might come in to help, if at all, he said. "This is a revolutionary change in the way banks are treated."

The rules foresee that banks' creditors and shareholders would be the first to take losses. But if that were not enough to prop up the lender, small companies and ordinary savers holding uninsured deposits worth more than 100,000 euros (£85,000) would also take a hit, officials said.

Those forced losses would go as high as 8% of a bank's total liabilities. Only then would national governments kick in and top it up with a bailout possibly worth another 5% of the liabilities.

The negotiations were complicated because some nations feared being bound by overly rigid European rules. Others warned that too much flexibility would create new imbalances between the bloc's weaker and stronger economies and a lack of common rules would destroy certainty for investors and erode trust in the financial system.

But the rules will now apply equally for the 17 EU nations sharing the euro currency and the 10 member states, including Britain, that have their own currency, Dijsselbloem said.

This year Cyprus had to seek a rescue loan after it could no longer shoulder the cost of bailing out its banks.

An initial agreement with the island's European creditors and the International Monetary Fund sparked market fears since it exposed small savers with deposits under the 100,000 euro guarantee to losses.

The deal was rapidly overhauled, but holders of large deposits in some banks were forced to take harsh losses.