Former CIA Director David Petraeus has agreed to plead guilty to mishandling classified materials, the US Department of Justice has said.

A Justice Department statement said on Tuesday that a plea agreement was filed in US district court in Charlotte, North Carolina.

The former top US army general was charged with one count of unauthorised removal and retention of classified material, which carries a possible penalty of up to a year in prison, a $100,000 fine and five years of probation.

The case was filed in Charlotte, the hometown of Paula Broadwell, the general's biographer and former mistress.

But the plea deal will allow Petraeus to avoid a trial that would have shone a light on embarrassing details of his affair and his flouting of secrecy laws.

According to court documents, Petraeus gave Broadwell binders of classified material from Afghanistan, which were known as "black books", while she was writing her book and then lied to federal investigators about providing them to Broadwell.

When Petraeus resigned from the CIA, he signed a security exit form indicating he had no classified material in his possession. However, he still had the black books in his home at that time. On April 5, 2013, the FBI searched his home and seized the black books from an unlocked desk drawer in a first-floor study.

The scandal marked an abrupt fall for Petraeus, a man who led US troops in Afghanistan and Iraq and was thought to be a potential candidate for president.

Source: Agencies