Serial sexter Anthony Weiner is under wraps at an inpatient addiction-treatment facility following the stunning jolt he delivered to the nation’s presidential race, it was revealed Wednesday.

Weiner — whose estranged wife, Huma Abedin, is a top aide to Democratic nominee Hillary Clinton — checked into a rehab center where electronic devices are banned, according to a report.

The unidentified facility reportedly has a counseling program for people hooked on cybersex and exhibitionism, as well as anonymous sex and pornography.

Patients there are also segregated by gender, the Daily Mail said.

Weiner — who quit Congress in disgrace and lost a comeback bid for mayor over separate sexting scandals — hasn’t been seen recently at his Manhattan apartment building, sources there told The Post.

During his first sexting scandal in 2011, Weiner took two weeks’ paid leave from the House of Representatives for “professional treatment” to become “a better husband and healthier person.”

But he later admitted to The Post, “I didn’t go to rehab anywhere.”

“A couple of days I worked with a therapist in Texas I was referred to. Two days, twice, for a total of four days. Or, it might have been three,” he said the day he joined the city’s 2013 mayoral race.

That campaign went down in flames when Weiner was revealed to have continued sexting using the nom de porn “Carlos Danger,” and he became embroiled in two more sexting scandals this year.

One of those — in which The Post revealed he snapped a kinky selfie while lying next to his toddler son — prompted Abedin to announce she was finally leaving him.

On Friday, Weiner rocked the race between Clinton and Republican Donald Trump when it was revealed the feds found a huge cache of Abedin’s emails on a laptop computer Weiner is suspected of using to exchange explicit messages with an underage girl.

Some of Abedin’s emails are believed to have been sent to and from the private computer server that Clinton used while secretary of state.

FBI Director James Comey in July recommended no charges against Clinton over her use of the server, but he told Congressional leaders that the new emails “appear to be pertinent to the investigation” and that agents would review them “to determine if they contain classified information.”

Trump has since surged in public-opinion surveys, pulling ahead of Clinton by 1 percentage point in an ABC/Washington Post tracking poll released Tuesday.