Former CIA director and retired US general David Petraeus has been sentenced to two years probation and handed a $100,000 fine for leaking secrets to a mistress who was writing his biography.

Petraeus pleaded guilty at sentencing in Charlotte, North Carolina, on Thursday after already agreeing to a misdemeanor count of unauthorised removal and retention of classified material two months earlier.

Initially, Petraeus was expected to pay a $40,000 fine but the judge raised the figure noting it needed to be higher to be punitive.

As part of the agreement filed with prosecutors in March, the government said it would not seek any prison time.

Al Jazeera's Kimberly Halkett, reporting from the courthouse in Charlotte, said Petraeus appeared nervous but spoke loudly and clearly when saying he understood the plea deal. 

"The judge considered the career and 37 years of military and public service," Halkett said.

"Given the praise of high-ranking officials, supplied to the court in the form of 34 letters of praise for Petraeus, the court accepted the recommendation of the Department of Justice of a penalty of two years probation."

A retired four-star army general who led US forces in Iraq and Afghanistan, Petraeus agreed not to contest a set of facts laid out by the government as part of the deal in order to possiblu avoid an embarassing trial.

Prosecutors had alleged that while the general's biographer, Paula Broadwell, was writing her book in 2011, Petraeus gave her eight binders of classified material he had improperly kept from his time in Afghanistan.

Days later, he reportedly took the binders back to his house.

'Black books'

Among the secret information contained in the "black books" were the names of covert operatives, the coalition war strategy and notes about Petraeus' discussions with President Barack Obama and the National Security Council, prosecutors said.

Prosecutors said that after resigning from the CIA in November 2012, Petraeus had signed a form falsely attesting he had no classified material.

He also lied to FBI agents by denying he supplied the information to Broadwell, according to court documents.

On April 5, 2013, the FBI searched his home and seized the black books from an unlocked desk drawer in a first-floor study.

Civil liberties and government transparency advocates had criticised the government's lenient treatment of Petraeus suggesting prosecutors maintain double standards.

Other leak case defendants have received harsher punishments, such as former CIA officer John Kiriakou, who was sent to prison.

The scandal marked an abrupt fall for Petraeus, a man who was at one point was thought to be a potential candidate for president.

Source: Al Jazeera and agencies