A seven-term Democrat, Mr. Weiner had hoped his declaration last weekend that he would seek mental health treatment and take a temporary leave from Congress would ease the pressure from Democratic leaders for him to step down. But their demands only grew louder as revelations about his conduct continued.

“I am announcing my resignation from Congress, so my colleagues can get back to work, my neighbors can choose a new representative and most important so that my wife and I can continue to heal from the damage I have caused,” Mr. Weiner said at the news conference.

Ms. Abedin was with Mr. Weiner at his Queens apartment as he prepared to make his statement, but did not appear at his side at the event.

The announcement brought swift relief to his Democratic colleagues, who had become increasingly uneasy as details emerged about Mr. Weiner’s online contacts with women — including his sending of explicit photos of himself to them over Facebook and Twitter. Democratic leaders had prepared to hold a meeting on Thursday to determine whether they should strip Mr. Weiner of his committee assignments, which would have severely impaired his effectiveness.

Mr. Weiner reached his decision late Wednesday, and seemed at peace with it, after days of appearing frazzled and torn, a person who spoke to him said. He began telling his most trusted advisers on Wednesday night, then held a conference call with his entire staff, informing them that it no longer seemed fair to his constituents and his colleagues for him to remain in office.