Weiner pleaded guilty to a single count of transmitting sexual material to a minor, admitting he began exchanging online messages with the girl in January 2015 and engaged in obscene communications that included "sharing explicit images and encouraging her to engage in sexually explicit conduct".
"I have a sickness, but I do not have an excuse," he said.
Pleading to the charge, which will require that he register as a sex offender, exposes him to a sentence of up to 10 years in prison, but Weiner signed a plea agreement with prosecutors in which he agreed not to appeal any sentence between 21 and 27 months in prison. His lawyer can request leniency at a sentencing scheduled for September 8.
Wearing his wedding ring and a dark blue suit with a maroon tie, Weiner read from a prepared statement after US District Judge Loretta A Preska addressed him: "Tell me what you did, sir."
More From This Section
"I engaged with many of them in both sexual and non- sexual conversation," he said. "These destructive impulses brought great devastation to my family and friends and destroyed my life's dream in public service. Yet I remained in denial even as the world around me fell apart."
Weiner said he began getting mental health treatment in the fall, when he said he "came to grips for the first time with the depths of my sickness". He said he continues to follow the treatment daily.
Weiner apologised to "everyone I have hurt", including the girl he "mistreated so badly".
Finished speaking, he wiped his eyes with tissues.
Weiner was already in federal custody ahead of the hearing, which lasted less than a half hour. Afterward, he shook hands with prosecutors, telling them: "Thanks, guys. I appreciate your service."
He then went down the courthouse elevator surrounded by his lawyers and court officers and left the building. He said nothing to reporters.
The FBI began investigating Weiner in September after the 15-year-old North Carolina girl told the news website DailyMail.Com that she and the disgraced former politician had exchanged lewd messages for several months.
The investigation led FBI agents to seize his laptop computer, which led to the discovery of a new cache of emails that Democratic presidential candidate Hillary Clinton had sent to Huma Abedin, Weiner's wife.
In late October, just days before the election, FBI Director James Comey stunned the country by announcing that his agency was reopening its closed investigation into Clinton's handling of State Department business on a private email server so it could analyse the newly discovered correspondence.
That inquiry was brief. Comey announced shortly before the election that the new emails contained nothing to change his view that Clinton could not be charged with a crime. But Clinton partly blamed her loss to Republican Donald Trump on Comey's announcement.
He ran for New York City mayor in 2013 and was leading several polls until it was revealed he had continued his questionable behaviour. His failed mayoral bid was the subject of the documentary "Weiner".