David Petraeus, the retired general who headed the Central Intelligence Agency until details of a sordid affair drove him to resign in 2012, was sentenced on Thursday for leaking classified secrets to his former mistress.

Petraeus appeared at the federal courthouse in North Carolina on Thursday afternoon to plead guilty to one count of unauthorized removal and retention of classified information, a misdemeanor. He was sentenced to two years of probation and a $100,000 fine.

The judge raised the fine from $40,000 in the plea agreement to “promote respect for the law and adequate deterrence.” Petraeus has to pay the fine immediately, or in $25,000 monthly installments.

“I now look forward to moving on with the next phase of my life, and serving this great nation as a private citizen,” Petraeus said in a short statement outside the Charlotte courthouse.

The former CIA chief admitted in court documents filed last month that he had provided his biographer and mistress, Paula Broadwell, with personal notebooks containing highly-sensitive details, including “classified information regarding the identities of covert officers, war strategy, intelligence capabilities and mechanisms, diplomatic discussions, quotes and deliberative discussions from high-level National Security Council meetings.”

Federal prosecutors had previously recommended pursuing felony charges against Petraeus, but accepted a plea deal signed in early March.

Investigators had originally opened up a probe against the then-CIA director in 2012 after a Florida socialite received threatening messages which officials were able to tie to Broadwell. In the midst of that investigation, authorities discovered that Broadwell had obtained sensitive United States documents and launched a new probe to identify the source.

Meanwhile, attorneys for Stephen Kim—a former State Department official convicted recently of leaking to the media—sent a scathing letter to the Justice Department last month in response to what they called a “profound double standard” evidenced by the Petraeus plea agreement.

“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,” Kim’s lawyer, Abbe Lowell, wrote three days after the ex-CIA chief pleaded guilty.

“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.”

“We are safer because of the work that Dave Petraeus has done,” US President Barack Obama said upon the retired general’s resignation. “And my main hope right now is — is that he and his family are able to move on and that this ends up being a single side note on what has otherwise been an extraordinary career.”