There wasn’t supposed to be any downside for Anthony Weiner in running for mayor of New York.

He found it.

In an extraordinary news conference Tuesday beside his wife, Huma Abedin, Weiner confirmed an account on the gossip site the Dirty, which reported a series of explicit conversations and lewd photos that the former congressman exchanged with a young woman, all apparently under the nom de plume Carlos Danger. Weiner, who resigned from office when his habit of tweeting dirty selfies became public two years ago, has repeatedly stated that other such digital indiscretions could surface, a point he made again Tuesday evening. But as his wife looked on, he also confirmed that some of those erotic messages were sent after his resignation from Congress, and well into his redemption tour, including after a July 2012 People magazine article in which Abedin said that Weiner had spent “every day” since the scandal working to be the “best dad and husband” possible.

Weiner, wearing a pen in the pocket of his blue shirt, said Tuesday he hoped the city’s voters would still “give me a second chance.” But this time, the acclaimed political showman served as the opening act. Abedin, who followed his comments, smiled broadly, nodded supportively and spoke confidently.

Abedin, who is perhaps Hillary Rodham Clinton’s closest aide, appears in Weiner’s ads and on the campaign trail. Nevertheless, she said she was “very nervous” in her first speaking appearance at a news conference, addressing reporters from in front of a cubicle wall. She said that through effort and “a lot of therapy,” the couple had worked out their problems. “Anthony has made some horrible mistakes,” Abedin said.

Mistakes and chances have become unknown variables in the new political math.

Weiner, after all, is operating in a political equation that allowed voters in South Carolina to forgive former governor Mark Sanford for his lusty non-hiking excursions and reward him with a seat in Congress. If anything, Weiner has emerged as a pioneer in post-paramour politics. This month, Eliot Spitzer, the former New York governor who resigned in disgrace after a prostitution scandal, announced that he, too, would again seek office, that of New York City comptroller. That’s the very position Weiner considered before deciding that losing a relatively low-stakes race could prove fatal to his future political ambitions. A respectable loss in a race for mayor, on the other hand, could help restore him to political viability.

And soon after entering the race, he didn’t seem to be losing at all. On the campaign trail in June, Weiner paused during an interview in front of a train station in the Forest Hills neighborhood of Queens, remarked that the station had been dedicated by Teddy Roosevelt, accepted a shout of “Good luck” and rejected the notion that he was running for mayor because it was a no-lose situation.

“Look,” said Weiner, wearing an American-flag tie. “I don’t think anyone goes through this, as hard as it is, and as much as you subject yourself to, if you don’t want the job. Or if you don’t think you are going to win. I just don’t believe that that happens. It’s certainly not happening in this case.”

Moments later, he talked about how his wife had been a “enormous asset” in the race thus far. On Tuesday evening, as even the prospect of a respectable defeat was endangered by Carlos Danger, Weiner had to lean on her more than either would have wanted but probably not more than either expected. “I love him,” Abedin said. “I have forgiven him, and as we have said from the beginning, we are moving forward.”

The opponents Weiner has all but eclipsed since entering the mayoral race were less willing to move on. Thus far reluctant to traffic in his sex scandal, on Tuesday they seized on the new exchanges as a chance to put the spotlight squarely on Weiner’s weakness. One said “enough is enough”; another talked about “pornographic selfies.”

Back in June, Weiner, in an interview, described his time away from politics as restorative. “It was very nice,” he said. He talked about getting up early with his young son and sipping coffee on the couch with Abedin as they traded sections of the New York Times. He recalled a breakthrough when Abedin looked at him with astonishment that he would rather read a story about miners than a profile about the Republican who took his congressional seat. “ ‘Who have you become that you don’t read the political stuff first anymore?’ ” he recalled her asking. “And I realized something had happened. But in answer to the question, no, I was not watching C-SPAN 3 in the middle of the night.”

He then interrupted himself to yell at a volunteer.

“You got to move the sign people closer to me. People look at the sign and then they look for me — that guy’s got to come over here.”