Trustpower then filed court action in 2011 against Inland Revenue and Justice Pamela Andrews found in favour of the electricity company last November.
But Inland Revenue challenged that ruling and the Court of Appeal overturned it this morning.
IRD refusing Trustpower's tax deductions for 2006, 2007 and 2008 was confirmed in today's decision.
The ruling from Justice Ellen France, Douglas White and Forrest Miller also means Trustpower will have to return costs from the High Court case of $1.17 million as well as pay IRD's costs for the appeal.
A note in Trustpower's accounts says that if IRD won it would be liable to pay $5.9 million in tax and interest of $3.0 million.
However, there could also be a flow on effects for other tax years.
"Inland Revenue has reassessed the 2009 and 2010 [tax] years and has made further claims. Trustpower has disputed this assessment. The dispute has been lodged with the High Court but is on hold pending the 2006 to 2008 dispute," notes in Trustpower's latest accounts say.
If IRD was completely successful for these additional years Trustpower says it would have to pay a further $6.4 million.
"The impact of these adjustments on the tax expense in the income statement is difficult to estimate but is unlikely to exceed $2,500,000 for all years up to March 2015," the note said.
Read the Court of Appeal's decision here: