NEW YORK — Anthony Weiner found himself caught in another sexting scandal Tuesday like the one that destroyed his congressional career, but stood side-by-side with his wife to say that he won’t drop out of the race for mayor of New York.

“This is entirely behind me,” Weiner said at an evening news conference, hours after the gossip website The Dirty posted X-rated text messages and an explicit photo that it said the former congressman exchanged with a woman.

Weiner confirmed sending photos and messages to a woman online and acknowledged some of the activity took place as recently as last fall, more than a year after he resigned from the House in disgrace for the same sort of behavior with at least a half-dozen women.

“I want to bring my vision to the people of the city of New York,” Weiner said, his wife smiling faintly and shyly by his side. “I hope they are willing to still continue to give me a second chance.”

Weiner then turned the microphone over to his wife, Huma Abedin, who did not appear with him at the June 2011 news conference when he stepped down from Congress. This time, she reaffirmed her support for her husband and said the matter is “between us.”

“I love him, I have forgiven him, I believe in 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.

Abedin said her husband had made some “horrible mistakes both before he resigned from Congress and after” but insisted she and her husband discussed “all of this” before he jumped into the mayor’s race in May.

The latest disclosures 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 him to drop out of the race.

The 48-year-old Democrat has been near the top of most mayoral polls since his late entry into the race.

“I said that other texts and photos were likely to come out and today they have,” said Weiner, who added that he was surprised that more had not previously surfaced. “It’s in our rear-view mirror, but it’s not far.”

After the news conference, Weiner attended a mayoral forum on gay men’s issues and was warmly received.

The woman with whom he exchanged the messages was not identified by The Dirty. She told the website 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 a few 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. At one point, the man reported to be Weiner wrote, “I’m deeply flawed.”

The woman said Weiner promised to help her get a job at the political website Politico and suggested meeting in a Chicago condo for a tryst.

The woman claimed that she and Weiner also exchanged nude photos of themselves and engaged in frequent phone sex.

“This was a bad situation for me because I really admired him. Even post-scandal, I thought he was misunderstood. Until I got to know him. I thought I loved him. Pretty pathetic,” the woman was quoted as telling the website.

She said he later asked her to destroy the evidence of their chats. She insisted that she never had sex with Weiner or received any payment from him.

The woman claimed her relationship with Weiner ended in November 2012. She said she last heard from him this past April, when his intended mayoral run was first revealed in a New York Times Magazine profile.

Weiner claimed that not every allegation made by the woman was true but said that he was not going to dispute specific claims.