Westpac Bank faces a tax bill of close to $1 billion after losing one of New Zealand's largest ever tax avoidance cases.

In a judgement delivered this afternoon, Judge Rhys Harrison says the bank was lucky the Inland Revenue Department didn't attack other parts of the transactions in dispute.

"I have rejected Westpac's primary arguments on all contested issues," said Judge Harrison, who ruled that the four transactions in dispute were created solely for the purpose of tax avoidance.

The arrangements assisted Westpac in determining what rate of tax it chose to pay in New Zealand, and the court heard evidence that the bank was advised to declare tax publicly at a rate of around 15 per cent, and make actual payments of at least 6 per cent, compared with the legislated corporate tax rate of 30 per cent.

Westpac is up for $961 million in back taxes and accrued interest on the IRD's assessments relating to cross-border structured finance transactions of a kind widely used by foreign-owned New Zealand banks in the late 1990's and early 2000's to reduce their local tax liability. Punitive penalty interest could yet be charged on the transactions.

Westpac is the second foreign-owned bank to fail to convince the New Zealand courts that its transactions were legitimate.

The Bank of New Zealand lost in the Wellington High Court in July and is now appealing a decision which leaves the National Australia Bank-owned BNZ facing back taxes and interest payments of $564 million, before any penalty charges are applied.

Westpac said in a statement it was "very disappointed" and would consider an appeal. The Australasian banking giant sought trading halts on its shares in New Zealand and Australia ahead of the judgement.

The judgement will be greeted with dismay by the four other banks lining up to contest the IRD's findings, especially as part of Westpac's legal strategy was to get the hearings moved to Auckland where they believed they would get a better hearing from what they believe is a savvier commercial Bench.

The ANZ and National Banks, which were separate entities when their disputed structured finance deals occurred, face tax and interest of around $562 million if their case fails, while the Commonwealth Bank of Australia-owned ASB is facing a $280 million liability.

Rabobank is involved in a smaller claim and Deutsche Bank settled with the IRD some time ago on similar issues.

The case is a huge win for the IRD and for the Crown Law Office, whose lead counsel in both the BNZ and Westpac cases, Rebecca Ellis, has recently been appointed a High Court judge.

Sources close to the case had expected that while Westpac might not convince Judge Harrison on a central aspect of the transactions - a so-called Guaranteed Procurement Fee that allowed parties effectively to decide how much tax they would pay in New Zealand - there was no expectation of a slam-dunk victory for the IRD.

Judge Harrison said: "Westpac's challenge to the (IRD) Commissioner's reassessments must fail. The bank has failed to discharge its onus of proving that the Commissioner erred, either in fact or law. It may count itself fortunate that he did not, on his hypothetical reconstruction, disallow the bank's claim for exempt income."

Not only was the GPF feature of the transactions unlawful and therefore correctly disallowed, all four transactions tested in the case "were tax avoidance arrangements entered into for the purpose of avoiding tax"