David Petraeus — the retired four-star general and former CIA chief whose stellar career ended in disgrace when he confessed to giving top secret information to his mistress — may be retroactively demoted.

Sources tell The Daily Beasta demotion — likely to lieutenant general — is being weighed by Secretary of Defense Ash Carter and could cost the 63-year-old Petraeus "hundreds of thousands of dollars" in benefits.

The Army previously recommended that the disgraced military veteran's rank not be lowered.

An unnamed defense official told The Daily Beast the demotion is under consideration to send a message "that even men of Petraeus's fame and esteemed reputation are not immune to punishment."

Petraeus didn't respond to a request for comment from The Daily Beast.

In 2012, Petraeus resigned as CIA director after it emerged he was engaged in a steamy affair with writer Paula Broadwell, whom he had given classified information about the war in Afghanistan.

To avoid prison, he agreed to plea to a misdemeanor count of unauthorized handling classified information and was sentenced to probation and a $100,000 fine.

David Petraeus - the retired four-star general and former CIA chief whose stellar career ended in disgrace when he confessed to giving top secret information to his mistress - may be retroactively demoted.