Tech giant Apple paid no tax in New Zealand (NZ) for at least a decade, despite making billions of dollars worth of profits in the country amounting to $4.2bn.

Apple sold 221,000 iPhones in NZ in the three months to December 2016 alone.

An investigation by the NZ Herald newspaper found Apple’s local unit paid about NZ$37m ($26m) in taxes since 2007 to the Inland Revenue Department in Australia instead.

Apple New Zealand’s parent company is registered in Australia and the two countries have a treaty where tax is only paid in one jurisdiction.

“It is absolutely extraordinary that they are able to get away with paying zero tax in this country. I really like Apple products — they’re incredibly innovative — but it looks like their tax department is even more innovative than their product designers,” said NZ’s Green Party co-leader James Shaw.

Apple responded to criticism, insisting that their tax arrangement was legal.

“Apple is the largest taxpayer in the world and we appreciate and respect the role taxes play as necessary and important in our society,” the company said.

“We follow the law and pay tax on everything we earn, wherever we operate. Apple aims to be a force for good and we’re proud of the contributions we’ve made in New Zealand over the past decade.”

Australia’s corporate tax rate of 30 percent is higher than New Zealand’s 28 percent, making the arrangement an unusual one.

Earlier this month, New Zealand’s revenue minister Judith Collins announced plans to crackdown on companies with a global turnover of more than $809m (NZ$1.1b) who engage in tax avoidance practices.

The consultation period ends on 7 April.

Similar plans in Australia were announced earlier this week to prevent large global corporations with annual incomes of more than $1bn from dodging their tax obligations.