The lawyer for imprisoned leaker Stephen Kim has asked the Department of Justice to immediately release him from jail, accusing the government of a “profound double standard” in its treatment of leakers following a comparatively lenient plea deal for former Gen. David Petraeus.

Petraeus avoided prison time for disclosing a trove of classified information to his lover and lying to the FBI about it. Kim, meanwhile, was sentenced to 13 months in prison for violating the Espionage Act by talking to a Fox News reporter about a single classified report on North Korea. Kim pleaded guilty after a five-year legal battle that depleted his finances and sent him to the brink of suicide. Petraeus, in the wake of his plea arrangement, is expected to continue his lucrative career working for an investment bank and giving speeches.

Kim’s lawyer, Abbe Lowell, noted in a scathing letter to the DOJ that Petraeus, in his plea deal, admitted leaking a range of highly sensitive material “at least as serious and damaging to national security as anything involved in Mr. Kim’s case” to Paula Broadwell, his lover and authorized biographer. Petraeus also acknowledged that when he was director of the CIA he lied to the FBI about leaking to Broadwell, as well as about keeping classified information at his home.

Yet while Kim, a former State Department official, was prosecuted under a draconian law against leaking — even though he merely discussed a single document that a government official later described in court filings as a “nothing burger” — Petraeus was allowed to plead guilty to a misdemeanor offense of mishandling classified information, and he was not charged at all for the felony of lying to the FBI. Under the deal, he is expected to be placed on probation for two years and pay a fine of $40,000.

“The decision to permit General Petraeus to plead guilty to a misdemeanor demonstrates more clearly than ever the profound double standard that applies when prosecuting so-called ‘leakers’ and those accused of disclosing classified information for their own purposes,” Lowell wrote in his two-page letter, which was dated March 6, just three days after the Petraeus plea deal was announced. “As we said at the time of Mr. Kim’s sentencing, lower-level employees like Mr. Kim are prosecuted under the Espionage Act because they are easy targets and lack the resources and political connections to fight back. High-level officials (such as General Petraeus and, earlier, Leon Panetta), leak classified information to forward their own agendas (or to impress their mistresses) with virtual impunity.”

Lowell was referring to former CIA director Leon Panetta, who was not punished even though, according to a report by the Defense Department’s inspector general, he leaked the name of the SEAL commando who led the raid that killed Osama bin Laden. Other senior officials who have avoided jail time for offenses related to classified information include former Attorney General Alberto Gonzales, who was “admonished but not charged” for keeping classified information at his house; John Deutch, the former CIA director who resigned and lost his security clearance but was not charged for storing classified documents on a home computer; former National Security Adviser Sandy Berger, who was allowed to plead guilty to a misdemeanor after he surreptitiously removed classified documents from the National Archives, and former Gen. James Cartwright, who reportedly has been investigated as the source for a New York Times story on Stuxnet but has not been charged. Scooter Libby, who was Vice President Dick Cheney’s chief of staff, was convicted in 2007 of obstructing an investigation into the leak of a CIA agent’s name, but his sentence was later commuted by President George W. Bush.

The imbalance of justice — high-level officials lightly punished while lower-level officials go to jail (such as John Kiriakou) or face years of career-ruining prosecution (such as Thomas Drake) — was emphasized by Stephen Kim’s sister, Yuri, in a statement to The Intercept. “Our family and our friends think it is just terribly unfair and not right that Stephen was given less consideration and different treatment for doing no more, and even less than General Petraeus,” she stated. “The general got the right result, but so should have Stephen. Stephen’s lawyers tried to get the Justice Department to address this disparity but they would not do so. We want others to know this.”

Although it seems unlikely that Lowell’s letter will lead to Kim’s immediate release, it makes an argument that will probably be at the heart of the sentencing of Jeffrey Sterling, a former mid-level CIA official who earlier this year was convicted of violating the Espionage Act by leaking classified information to a Times reporter. Sterling, due to be sentenced in April, faces a maximum penalty of decades behind bars. His lawyer is likely to cite the Petraeus deal in an effort to avert a prison sentence, because Sterling’s actions, like Kim’s, are similar to Petraeus’s and, if anything, perhaps less serious. If the government wishes to be consistent with the Petraeus deal, Sterling would, the argument goes, not serve any jail time.

Kim, meanwhile, has been incarcerated at a federal prison in Cumberland, Maryland since July.

“It is too late for us to undo the plea and seek the misdemeanor that Mr. Kim should have been offered,” Lowell wrote. “However, some justice and fairness can occur, even at this late date, by our at least joining to end his incarceration now.”

Previous Intercept stories on the Stephen Kim case:

Stephen Kim Spoke To A Reporter. Now He’s In Jail. This Is His Story.

The Surrender (a short documentary by Stephen Maing)

Petraeus Plea Deal Reveals Two-Tier Justice System for Leaks