The government is entitled to any money former National Security Agency leaker Edward Snowden makes from his memoir and paid speeches because he disclosed classified information without approval, a federal judge ruled Tuesday.

Snowden has been charged with espionage since 2013, when he exposed top-secret surveillance documents in what may have been the biggest security breach in U.S. history.

The former contractor sees himself as a whistleblower compelled to reveal sweeping surveillance programs hidden from the American people. But through two administrations, the government has viewed him as a traitor who escaped justice by fleeing to Russia.

Unable to put him on trial, the Justice Department this year moved to cut off his profits from the book he published, “Permanent Record,” as well as from paid speeches.

In a brief opinion in federal court in Alexandria, Judge Liam O’Grady ruled in the government’s favor. “The contractual language of the Secrecy Agreements is unambiguous,” he wrote. “Snowden accepted employment and benefits conditioned upon prepublication review obligations.”

Snowden’s attorneys said they disagree with the court’s decision and will review their options.

“It’s farfetched to believe that the government would have reviewed Mr. Snowden’s book or anything else he submitted in good faith. For that reason, Mr. Snowden preferred to risk his future royalties than to subject his experiences to improper government censorship,” Brett Max Kaufman, a staff attorney with the ACLU’s Center for Democracy and member of Snowden’s legal team, said in a statement Tuesday.

Nothing in the book was sent for approval to the CIA or National Security Agency as required under the secrecy agreements Snowden signed as a contractor. Snowden acknowledged breaking the rules in a “Daily Show” interview, saying he didn’t want to “let the CIA edit [my] life story.”

But he argued through attorneys that nothing in his public talks revealed new information, and that it would have been “futile” to submit his manuscript for approval because the government would never have reviewed it “in a good faith and timely fashion.”

His attorneys also argued that Snowden was singled out among the many former intelligence operatives who have written or spoken about their experiences.

The NSA ended its mass collection of data about Americans’ phone calls after Snowden’s leaks forced the government to confirm the program’s existence.

O’Grady said it did not matter that the classified information at issue had been exposed.

“Mere public availability does not place information or materials in the public domain,” he wrote.

O’Grady canceled a hearing that had been set for last week in the case, saying he did not need oral arguments to make his decision.

The government has won royalties in similar cases. In 2016, a former Navy SEAL who wrote a book about the raid that killed Osama bin Laden agreed to pay $6.8 million in royalties to the government. The CIA fought up to the Supreme Court in 1980 to win royalties from a former analyst’s book on the failures of the Vietnam War.

Several writers from the intelligence community have been battling the government in court over the review process, saying it has become unconstitutionally politicized.

Snowden has said he would like to return to the United States, but only if he would be allowed to defend himself at trial by asserting his actions were in the public interest. That type of defense is not allowed under U.S. law.