WASHINGTON - David Petraeus, the retired four-star general who once commanded military operations in Afghanistan and Iraq, pleaded guilty Thursday in federal court to leaking classified information to his mistress and biographer, Paula Broadwell, and was sentenced to two years probation and a $100,000 fine.

The sentence did not include any prison time, but the fine was $60,000 higher than the terms reached in a plea deal two months ago with Petraeus that the judge was not obliged to follow, according to American television reports.

Petraeus, who also commanded US-led coalition troops in Afghanistan, pleaded guilty to one misdemeanor count of unauthorised removal and retention of eight highly secret ‘black book’ binders that he had improperly retained from his time as top military commander in Afghanistan. US Magistrate Judge David Keesler, asked Petraeus on Thursday if he was guilty of the misdemeanor. “I am,” Petraeus replied, according to the reports.

After the court heard letters of support for leniency, including one from a former military aide, the 62-year-old former commander addressed the court.

“I’m honoured and humbled by their words and support,” he said, according to the reports. “I want to apologise for the pain my actions caused.”

The US attorney called for a ‘fair and just’ sentence, but noted that mishandling sensitive secrets is a ‘serious offence’ and a violation of the nation’s trust. Moreover, the prosecutor said, Petraeus “betrayed that trust, then lied about it to the FBI.”

While on probation, the retired general, who is currently advising the White House on Middle East security issues, can travel internationally with approval of probation officer.

Petraeus, wearing a dark blue suit, arrived an hour early for his court appearance and told reporters he would make a statement after the hearing.

The once widely celebrated military leader, who resigned as CIA director when the affair with Broadwell was exposed in 2012, was accused of giving her the material while she was working on the biography, All In: The Education of David Petraeus, which was published in 2012.

Both Petraeus and Broadwell, 43, publicly apologised over the scandal and said their romantic relationship began only after he had retired from the military. The general’s wife, Holly, has supported him during the ordeal.

After resigning as head of the spy agency, Petraeus signed a form falsely attesting he had no classified material, prosecutors said. He also lied to FBI agents by denying he supplied the classified information to Broadwell.

The binders, which Petraeus eventually recovered from Broadwell, were seized by FBI in April 2013 in a search of Petraeus’ home in Arlington, Virginia. The “black books” were found in an unlocked drawer of a desk in the ground-floor study.

The binders included, among other things, the names of covert operatives, coalition war strategy, and even notes about Petraeus’ discussions with President Obama and the National Security Council, prosecutors said.

After the scandal broke, Petraeus initially maintained a low-profile, taking positions at universities.

He is now chairman of the KKR Global Institute, part of the private-equity firm Kohlberg Kravis Roberts.

Petraeus has also recently been serving as a consultant to the The National Security Council and Obama administration on matters related to Iraq and the Islamic State extremist group, White House Press Secretary Josh Earnest confirmed on Monday.