Former CIA Director David Petraeus will plead guilty to giving classified information to a woman with whom he had a relationship while serving as head of the CIA, a Department of Justice spokesman told NBC News on Tuesday.

RELATED: Eric Holder won’t say if David Petraeus will be indicted

Court papers — including a plea agreement and a statement of facts — were filed in United States Division Court Tuesday, the latest scene in a spectacular fall from grace for the general who lead two wars, ran the CIA and was thought to have potential as a Republican vice presidential pick in 2012.

The charges carry a maximum sentence of one year.

Petraeus had an extramarital affair with his biographer, Paula Broadwell, a former Army Reserve officer who was writing “All In: The Education of General David Petraeus” at the time. During interviews, Broadwell requested and he later gave her classified notebooks that contained handwritten notes about meetings, war strategy, intelligence, and names of covert officers.

The plea agreement saves Petraeus from participating in a messy trial that would bring details of the affair out into the public. Petraeus remains married to his longtime wife, Holly.