The story broke earlier in the day when the gossip website The Dirty posted the X-rated correspondence and quoted the woman, who was not identified.
Weiner turned the microphone over to his wife, Huma Abedin, who reaffirmed her support and said the matter is "between us."
"I love him. I have forgiven him. And as we have said from the beginning, we are moving forward," said Abedin, a longtime adviser to former Secretary of State Hillary Rodham Clinton.
The allegation could severely test voters' willingness to forgive Weiner, who has said he spent the two years since the scandal trying to make things right with his wife and earn redemption. Three of his rivals for mayor immediately called on Weiner to drop out of the race.
The 48-year-old Democrat, who resigned his House seat in June 2011 after acknowledging having sexual conversations with at least a half-dozen women, has been near the top of most mayoral polls since his late entry into the race this spring.
"I said that other texts and photos were likely to come out and today they have," Weiner said in a statement issued by his campaign. "I want to again say that I am very sorry to anyone who was on the receiving end of these messages and the disruption this has caused."
The woman with whom he exchanged the messages told The Dirty that she was 22 when she began chatting with Weiner on the social networking site Formspring. She said their online relationship began in July 2012 and lasted for six months.
She claimed Weiner used the alias "Carlos Danger" for their exchanges, but she knew she was talking to the former congressman.
The exchanges posted on The Dirty consist of sexually explicit fantasizing about various sex acts.
The disclosure suddenly puts Weiner's indiscretions, judgment and candor back in the forefront of his campaign and could test voters' confidence in him, analysts said.