Former CIA boss and head of US forces in Iraq and Afghanistan, David Petraeus, has escaped with just two years’ probation and a $100,000 fine despite admitting handing over classified military material to his biographer.

Petreaus struck a deal with prosecutors to get out of a jail term, pleading guilty to mishandling classified information. He was facing charges which could have landed him a stretch of several years in the slammer.

Acting US Attorney Jill Westmoreland Rose issued the following brief statement on Thursday:

“David Petraeus appeared before US Magistrate Judge David Keesler of the Western District of North Carolina today and admitted to the unauthorized removal and retention of classified information and lying to the FBI and CIA about his possession and handling of classified information. Petraeus was sentenced to a two-year probationary term and was ordered to pay $100,000 fine. I want to thank my colleagues at DOJ National Security Division, the Charlotte FBI office for leading the investigation, as well as all our investigative partners for their work on the case.”

Petraeus had handed over binders of material – including the identities of undercover officers, military strategy, code words and info from White House National Security Council meetings – to his biographer Paula Broadwell, according to court records seen by Reuters.

His wrongdoing would never have come to light had it not been for an email harassment case the FBI was called to investigate by Petraeus’ friend, Jill Kelley.

It transpired that the threatening emails led back to US Army Reserve officer Broadwell, with whom Petraeus was having an affair. He was subsequently forced to resign as head of CIA just a year into the job.

Although magistrate judge David Keesler raised the fine from $40,000 on account of the gravity of the offence, the sentencing was not welcomed by all.

"A slap on the wrist is the most one could say about what can barely be called a sentence for what could have been treated as serious crimes including espionage,” argued Julian Assange lawyer, Michael Ratner.