Bernard Collaery has successfully challenged a ruling that would have seen much of his trial conducted behind closed doors, with a court finding open justice deters "political prosecutions" and secrecy risks damaging public confidence in the legal system.
The Canberra lawyer is fighting five charges, alleging in part that he breached the Intelligence Services Act by sharing information about the Australian Secret Intelligence Service with journalists.
He is also accused of conspiring with his former client, the ex-spy known as Witness K, to illegally communicate protected ASIS information to the government of East Timor.
The allegations concern the exposure of a 2004 operation, in which Australian spies bugged a government building in the impoverished country during negotiations over lucrative oil and gas resources.
In the ACT Supreme Court last year, Justice David Mossop made a ruling under national security legislation to ban public disclosure of certain information that might be given at Mr Collaery's trial.
This order had been sought by then-federal attorney-general Christian Porter, with the effect being that significant parts of Mr Collaery's trial would be held in closed court.
Mr Collaery subsequently challenged the ruling in the ACT Court of Appeal, which unanimously allowed his appeal on Wednesday.
While Mr Collaery and his team agreed some sensitive information should not be made public, they argued material relating to "the truth of six specific matters" should be dealt with in open court.
Three Court of Appeal judges ultimately found there was a risk this could prejudice national security, but they doubted whether that risk was significant.
"On the other hand, there was a very real risk of damage to public confidence in the administration of justice if the evidence could not be publicly disclosed," Chief Justice Helen Murrell, Justice John Burns and Justice Michael Wigney said in a judgment summary.
"The court emphasised that the open hearing of criminal trials was important because it deterred political prosecutions, allowed the public to scrutinise the actions of prosecutors, and permitted the public to properly assess the conduct of the accused person."
The Court of Appeal therefore set aside Justice Mossop's order.
It remitted the matter to the Supreme Court for further consideration about whether any of the material in the trial should be considered "judge-only evidence".
The federal government has not told Mr Collaery or his lawyers precisely what it argues should fall into this category, proposing that some material be shown to no one but the trial judge.
Mr Collaery, who had to wait outside the courthouse for news of the judgment on Wednesday, told reporters this meant there was "an unfinished aspect of the question of open justice".
He said he had found the whole process to date "very oppressive", but this latest decision was "a beacon to our legal profession".
"I regret that we have to go this far to achieve an appropriate balance between open justice, national security and the personal interests of those who become caught in that issue," he said.
Mr Collaery, who thanked his team of renowned lawyers, added that he supported the concept of protecting national security.
"But it has to be true national security, not issues of embarrassment or publicity," Mr Collaery said.
"That's the real issue."
The Human Rights Law Centre also welcomed Wednesday's decision, with senior lawyer Kieran Pender calling it "a win for transparency in Australia".
"While it's welcome news that this prosecution won't go ahead in complete secrecy, it shouldn't go ahead at all," he said.
Mr Pender described it as "profoundly unjust" for whistleblowers to be prosecuted.
Shadow attorney-general Mark Dreyfus said Labor strongly supported the principle of open justice.
In response to Wednesday's decision, he called for Attorney-General Michaelia Cash to "provide a detailed explanation as to why this prosecution remains in the public interest".
A spokesman for Ms Cash said the Commonwealth was "carefully considering the [court's] judgment".
Witness K, who pleaded guilty to a single conspiracy charge, was sentenced earlier this year to a suspended three-month jail term.
Mr Collaery on Wednesday said his former client was "a wonderful, loyal, decent man", and that he would never lose sight of how this saga had affected the former spy.
Our journalists work hard to provide local, up-to-date news to the community. This is how you can continue to access our trusted content:
Sign up for our newsletter to stay up to date.