David McBride, who helped expose allegations of war crimes committed by Australian soldiers in Afghanistan, has pleaded guilty to leaking classified information.
Outside court, a defiant McBride held his fist in the air and said it was "the beginning of a better Australia" and he wanted to shine a light on wrongdoings.
"I stand tall and I believe I did my duty," the former military lawyer told supporters in Canberra on Friday.
McBride entered the pleas after losing pre-trial arguments over a public interest element to the charges he faced.
The ACT Supreme Court also upheld a federal intervention to withhold key evidence, which it found could jeopardise national security and defence if released.
McBride will remain on bail and be sentenced next year.
Justice David Mossop ordered he undergo an assessment for a custodial sentence served in the community.
Under the order, McBride would be supervised and need permission to leave the ACT.
His wife Sarah said it had been an emotionally and financially draining fight, and while their two daughters had been through more than most, she wasn't giving up hope.
"He's done the right thing, I've said that from the beginning," she said.
"Truth and justice will prevail and I'm incredibly proud of him."
McBride's lawyer Mark Davis said they retained the right to lodge an appeal even though he pleaded guilty.
McBride sought to argue his oath to the defence force to "protect and serve" meant he needed to act in the public interest - even if that meant disobeying an order, which prosecutors rejected.
Justice Mossop shot down McBride's argument, saying there was no mention of public interest in the military oath.
He also refused a push from McBride's team to have classified information go before the jury, ruling the documents remain redacted.
The decisions meant McBride had little option but to plead guilty.
"The removal of evidence makes it impossible for us realistically to go to trial," Mr Davis said.
"It's a sad day and a difficult day for us to advise David on his options this afternoon and he embraced it."
Mr Davis said the ruling that McBride only had a duty to follow orders and not act in the Australian public interest was "a very narrow understanding of the law".
He again referred to the Nuremberg trial, which took place after World War II and held prominent Nazis to account for their crimes.
The war crimes tribunal rejected the argument German officers could be freed from consequences because they were only following orders.
"We all know how military law has been judged since then," Mr Davis said.
Originally facing five charges, McBride pleaded guilty to three offences including stealing commonwealth information and passing it onto journalists.
Human rights advocates called for Attorney-General Mark Dreyfus to pardon him, arguing jailing a whistleblower was not in the public interest and would stop others coming forward.
The leaked classified documents led to a series of reports alleging Australian special forces troops committed war crimes in Afghanistan.
An inquiry later uncovered credible information about 23 incidents of potential war crimes, which involved the killing of 39 Afghans and cruel treatment of two more between 2005 and 2016.