Weiner, 46, had waited for his wife - an aide to Secretary of State Hillary Clinton - to return from an overseas trip before he made his decision. Huma Abedin returned home on Tuesday night.
"I am announcing my resignation from Congress so my colleagues can get back to work, my neighbors can choose a new representative and, most importantly, that my wife and I can continue to heal from the damage I have caused," Weiner said.
Abedin was absent as he announced his decision, as she was 10 days ago when he admitted having sent inappropriate messages and photos to several women online. Abedin is pregnant with the couple's first child.
Weiner's salacious story started unraveling a few weeks ago when photos of him in his underwear surfaced online. He initially claimed his Twitter account had been hacked, but he eventually admitted he sent the pictures to several women himself.
A former porn star on Wednesday said the congressmen asked her to lie about several sexual messages he sent to her.
"I wish him the best and hope that the treatment that he is receiving will help him to control his impulses and make better judgments in the future," said Ginger Lee in a statement released on Thursday.
Weiner made his first public appearance at the news conference after taking a leave of absence for unspecified treatment, and there were cheers when he announced his resignation. The crowd included hecklers and radio shock jocks, vying for attention at what became a New York media event.
The White House commented for the first time on Monday on the scandal, calling his behavior "inappropriate" and "a distraction." President Barack Obama said if he were in Weiner's position, he'd resign.
In his 9th Congressional District, voters had mixed feelings about his departure.
"High school kids have done worse. He hasn't killed anybody. Seriously, get real. And I'm Republican," said one man.
Another woman said simply, "He's stupid, that's what he is. He got caught, while the others don't get caught."
A recent poll of Weiner's constituents showed that if he were on the ballot again, he would be reelected. Weiner did not say what he would be doing now, but he said he would look into other ways to "contribute his talents."
The Associated Press contributed to this story.