Former U.S. Rep. Anthony Weiner jolted the New York City mayoral race on Tuesday, admitting that at least some of the new, sexually charged online exchanges posted on a website and attributed to him were, in fact, his.

“I said that other texts and photos were likely to come out, and today they have,” Mr. Weiner said in a news conference where he was joined by his wife, Huma Abedin. “While some things that have been posted today are true and some are not, there is no question that what I did was wrong.”

The alleged exchanges were posted on gossip website thedirty.com Monday, but did not attract widespread attention until BuzzFeed wrote a story about them Tuesday.

“Perhaps I’m surprised more things haven’t come out sooner,” Mr. Weiner said. “This behavior that I did was problematic to say the least and destructive to say the most.”

He said he stopped having explicit conversations with women online “sometime last summer, I think.”

“Some of these things happened before my resignation [from Congress], some of them happened after,” he added.

He also said he will still seek the Democratic nomination for mayor, adding, “I’m sure many of my opponents would like me to drop out of the race.”

Abedin also took to the podium, saying it was the first time she has spoken at a news conference.

She said it took “a whole lot of therapy” to finally forgive her husband, who had made some “horrible mistakes.”

“It was not an easy choice in any way, but I made the decision that it was worth staying in this marriage. That was a decision I made for me, our son and for our family. I didn’t know how it would work out, but I did know I wanted to give it a try,” she said.

“I do believe it’s between us,” she said. “We discussed all of this before Anthony decided to run for mayor.”

“I love him, I have forgiven him, I believe in him and as we have said form the beginning, we are moving forward,” she said.

Mr. Weiner resigned from Congress in June 2011 after he admitted to sending lewd messages and photos to women online and then lying about it. He has tried to resurrect his political career with a bid for the Democratic nomination for mayor this year and has been running near the front of the pack in polls.

Sexually charged messages sent after Mr. Weiner’s resignation from Congress would be “very bad” for him, said Bill Cunningham, a New York City political consultant who is not working on a campaign.

“That would indicate that he didn’t learn his lesson,” said Mr. Cunningham, speaking before Mr. Weiner told a crowded room full of reporters in Manhattan that his online activity had continued after he resigned.

Regardless of when they were sent, Mr. Cunningham said, the messages are harmful to Mr. Weiner’s campaign.

“It just raises all of these questions he doesn’t need as he tries to run for mayor,” he said.

A spokeswoman for Mr. Weiner, Barbara Morgan, didn’t immediately respond to questions about when the messages were sent and which parts of the posts were true.

“This behavior is behind me,” Mr. Weiner said in the news release. “I want to again say that I am very sorry to anyone who was on the receiving end of these messages and the disruption that this has caused. As my wife and I have said, we are focused on moving forward.”

Several of Mr. Weiner’s opponents called on the former congressman to drop out of the race.

“From the moment he entered the race, I’ve said that Tony Weiner was unfit to serve as Mayor of our great city. Today, that is clearer than ever,” said Former City Councilman Sal Albanese, whose campaign has trailed badly in the polls.

And Republican candidate John Catsimatidis said, “The Mayor of New York City should be a leader that all the residents of our city, especially our children, can look up to. Anthony Weiner should do what is right for his family and our city and drop out of the race for mayor so we can end this soap opera.”