Four big banks have admitted defeat in a long-running battle with the tax department and admitted liability for more than $2.2 billion in unpaid tax.

Westpac, the ASB Bank, BNZ and ANZ-National last night agreed to settle cases with Inland Revenue and repay an amount believed to be just over $2 billion.

The agreement is believed to be New Zealand's largest commercial settlement.

The cases came about when the IRD took claims against the banks to the High Court.

The tax department said a complex mechanism known as "structured finance" that the banks were using to keep their tax bills down was tantamount to tax avoidance.

IRD Commissioner Robert Russell said the decision to pursue the cases was absolutely right, and it was a good result for New Zealand taxpayers.

"We believe this sends a strong signal to companies operating in New Zealand that, like all taxpayers, they must meet their obligations," he said.

Solicitor-General David Collins, QC, said the settlement showed that the IRD and Crown Law had the resources and ability to pursue complex cross-border transactions.

Revenue Minister Peter Dunne said the settlement was a "victory for legal process".

The Inland Revenue Department's pursuit of what it saw as a clear-cut case of tax avoidance, and its diligence on behalf of New Zealand taxpayers, had been rewarded, Mr Dunne said.

Most of the banks issued statements late last night after the decision was announced.

Westpac chief executive George Frazis said it was time to accept the settlement and "move on."

"We entered these transactions relying upon expert advice and rulings issued by the IRD in relation to a similar transaction," he said.

"But we accept the court has ruled and that on balance, it is best that we accept this industry settlement and move on."

ANZ-National Bank chief executive Jenny Fagg said her company was pleased a commercial settlement had been reached.

She said the bank believed the transaction structures were appropriate in light of advice it had received, but those transactions now needed to be approached differently.

BNZ said its Court of Appeal action had been cancelled after the agreement.

Chief executive Andrew Thorburn said: "We acted in good faith at the time.

"The High Court has delivered a judgment, and now it is time to settleso that we can move on and move forward."

The ASB Bank did not respond last night.