The latest ruling allows Dotcom to sue the Government Communications Security Bureau over his treatment.
A New Zealand appeals court ruled that Megaupload founder, Kim Dotcom, can sue the country's spy agency for illegally spying on him.
The New Zealand Appeals Court refused a request from the government to overturn a high court decision in December last year.
The latest ruling allows Dotcom to sue the Government Communications Security Bureau (GCSB) over his treatment.
The Appeals Court's ruling said: "It is preferable to require the addition of the Attorney-General as a separate party in respect of each Government entity in respect of which he or she is sued."
William Akel, one of Dotcom's lawyers, said "This will strengthen our case in so far as GCSB remains a party to the proceedings."
In September 2012, New Zealand Prime Minister John Key apologised to Dotcom for government agencies illegally intercepting personal communications which leading to his arrest.
Earlier this month, the US government won an appeal in its battle to extradite Dotcom from New Zealand.
The FBI alleges Megaupload copied and distrubuted copyrighted music and films, while making a profit of $175m since 2005.