The Treasury has closed two tax loopholes after Barclays tried to avoid paying more than £500 million in "highly abusive" dodges.
It is the first time the current Government has clawed back revenues retrospectively and the changes in the laws will ensure billions of pounds of tax are paid in the future.
The move by the Treasury will embarrass Barclays because it has signed up to a code of practice against tax avoidance and has stressed the importance of good citizenship.
Barclays said it flagged up the schemes to HMRC "in a spirit of full transparency" and insisted that it always operates within the law. But the Government decided the schemes, while legal, were in breach of a code of practice that has seen all the major banks pledge to pay their fair share of taxes.
It is understood that Barclays does not agree with the Treasury's estimate of a £500 million loss, with reports that the real figure is less than £200 million.
One of the tax schemes involved Barclays avoid paying corporation tax on profits it made buying back its own IOU-notes. The Treasury said it will move to block the recent use of the scheme by the bank and by any other company. The other scheme - believed to be devised by Barclays - saw investment funds trying to receive tax credits from the Treasury on non-taxable income. The Government brought in legislation on Monday to block future use of the scheme.
Exchequer secretary to the Treasury David Gauke said the Government was clear that "business must pay the tax they owe when they owe it".
"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," he said.
A spokeswoman for Barclays said the bank takes its responsibilities as a corporate citizen very seriously and had believed both schemes met the code of practice. She added: "Barclays respects the decision of HMRC and the Government to adjust the tax laws and will, of course, comply with the modified law once it is in place."
Prime Minister David Cameron's official spokesman said: "What you have learned today is that the Government takes tax avoidance very seriously. We will continue to take tough action on tax avoidance because we need to make sure that the tax system is fair for everybody."