Disgraced ex-Congressman Anthony Weiner has finally found something he can do without screwing it up.

Nearly a year after he began his 21-month prison sentence for sexting with an underage girl, Weiner, 54, is set to be released early for good conduct.

Weiner — who has failed at being a husband, at sex rehab and at politics because of his uncontrollable urges — has managed to be a model inmate at the Federal Medical Center in Devens, Mass., according to the federal Bureau of Prisons.

Prison records show he is scheduled to be released in May 2019, three months ahead of his scheduled release date in August 2019.

There is no parole in federal prison, but inmates can earn up to 54 days off each year they serve for good conduct.

If the Queens Democrat ends up getting sprung early, it will be his first success in close to a decade. Weiner’s dramatic and seemingly never-ending fall from grace kicked off in 2011, when he resigned from Congress after it emerged he had been sending photos of his privates to women online.

In 2013, he lost his bid to become NYC’s mayor when it emerged he had been continuing his sexting with strange women through the pseudonym “Carlos Danger.”

Weiner didn’t hit rock bottom, however, until he admitted in court last year to sexting with a high school girl — despite knowing she was a minor.

His long-suffering wife, long-time Hillary Clinton aide Huma Abedin, filed for divorce hours after he pleaded guilty in court.

Weiner begged for probation at his September 2017 sentencing, calling himself “a very sick man” as he wept.

His lawyer, Arlo Devlin-Brown, did not immediately return a request for comment.