The government is to end aggressive tax avoidance schemes used by banks from the profit they can make buying back their own bonds, in a move that could cost Barclays more than 100 million pounds.

The government said on Monday it was closing two tax loopholes immediately to save it more than 500 million pounds, adding the loopholes were disclosed to it by an unnamed bank.

Legislation would be introduced to retrospectively block its recent use by the bank that has disclosed the scheme and by any other company that has engaged in a similar scheme in the same period, the Treasury said.

The government also moved to plug another tax loophole whereby authorised investment funds seek to claim back tax from the treasury when no tax was paid in the first place.

By acting immediately, the Government will ensure the payment of over half a billion pounds in tax, protect further billions of tax from being lost and maintain fairness in the tax system, the UK government said in a statement.

Europe's banks are under pressure from regulators to bolster their capital and one way of doing this is to buy back their own debt under so-called liability management exercises (LME).

More than a dozen banks across Europe have announced such offers, including Barclays, which launched an offer on December 5. The Treasury said the retrospective element would date back to the start of December.

Barclays made about 450 million pounds on its bond buyback offer, according to Reuters estimates, so could face a tax bill of almost 120 million pounds based on a 26 percent tax rate.

Barclays declined to comment.

Lloyds Banking Group, which is 40 percent owned by the UK government, made a gain of 1.3 billion pounds on a liability management exercise carried out in December, although that offer involved exchange into other bonds, rather than the repurchase of the debt.

We do not take today's action lightly, but the potential tax loss from this scheme and the history of previous abuse in this area mean that this is a circumstance where the decision to change the law with full retrospective effect is justified, David Gauke, a junior minister for taxation, said in a statement.

The legislation for plugging the investment fund tax loophole will not be backdated.

(Reporting by Huw Jones and Steve Slater; Editing by Jon Loades-Carter)