Image caption There is strong opposition to charging taxpayers for banks' mistakes

An agreement reached on dealing with bank bailouts in the EU has been labelled a "big step" by a senior official in Brussels.

EU Commissioner Michel Barnier said the deal meant taxpayers were no longer on the "front line".

Under the new arrangements, each EU member state will build up a fund to help banks in trouble.

The fund will be built up from bank contributions, with banks that take more risks paying more .

It would move the risk away from small depositors and towards shareholders and bond holders of the bank experiencing difficulties.

Mr Barnier made the comments via Twitter on Wednesday evening.

'Bail-in system'

There is a chance that people with more than 100,000 euros (£84,000; $138,000) in savings may be affected, but they would be last in the pecking order, said the European Parliament.

It also said the deal does not rule out using public money in "exceptional circumstances".

Bank failures sparked crises in the Republic of Ireland, Spain and Cyprus.

Talks included all 28 EU member states, the European Parliament and the European Council.

The new approach will apply from 2016.

Public rescue ends

In an official statement, Mr Barnier said: "With these new rules in place, massive public bail-outs of banks and their consequences for taxpayers will finally be a practice of the past."

He said the talks would allow banks to "lend to the real economy", by aiming to make them stronger.

The amount banks would have to contribute depends on their attitude to risk, Mr Barnier said.

He said the move was a "fundamental step towards the completion of the banking union".

A Swedish member of the European Parliament, Gunnar Hokmark, was also in the talks.

He said: "We now have a strong bail-in system which sends a clear message that bank shareholders and creditors will be the ones to bear the losses on rainy days, not taxpayers."

The deal must still go through a final technical stage and it needs official approval by the EU member states and parliament.

Ministerial talks will start again next week, and a final agreement is hoped to be reached by the end of the month.