Retired Army Gen. David Petraeus, a top U.S. military commander of the past decade and the former director of the Central Intelligence Agency, pleaded guilty to leaking classified intelligence to his onetime mistress.

Petraeus, who commanded coalition forces in Iraq and Afghanistan, on Tuesday pleaded guilty in U.S. District Court in North Carolina to one count of unauthorized removal of classified material and retention of classified material. The charge carries a maximum sentence of one year in prison.

Petraeus was accused of sharing the classified information with his former lover, Paula Broadwell, a fellow Army officer and his biographer, during his tenure at the CIA. The married father of two -- who was once viewed as a possible contender for the Republican president nomination -- has apologized for the extramarital affair.

"I know I can never fully assuage the pain that I inflicted on those closest to me and a number of others," he said in 2013.

Petraeus' lawyers David Kendall and Robert Barnett in Washington declined to comment when asked by the AP.

The plea deal will allow Petraeus to avoid an embarrassing public trial. Petraeus also chose to issue his plea the same day Israeli Prime Minister Benjamin Netanyahu addressed a joint session of Congress on the controversial nuclear deal the U.S. is negotiating with Iran.

--Brendan McGarry can be reached at brendan.mcgarry@military.com