When Chelsea Clinton wanted to make a low-key visit to the hurricane-stricken Rockaways last fall, she arranged to take a trip with her close friend Huma Abedin, a longtime aide to Hillary Rodham Clinton.

So some members of the Clinton camp were surprised and unsettled to learn that Ms. Abedin also brought along her husband, Anthony D. Weiner, the former congressman who had rarely been seen in public since resigning his seat the previous year.

The next day, Mr. Weiner reactivated his Twitter account to post a video about the Rockaways. Photographs soon surfaced in New York news outlets of the former congressman in the ravaged Queens neighborhood, the former first daughter at his side.

As Mr. Weiner, a Democrat, seeks an improbable return to politics, announcing this week that he is running for mayor of New York City, some have wondered how a politician who exchanged sexually explicit messages with strangers could persuade his wife to undergo another excruciating period in the spotlight.

But the reality, it turns out, is just the opposite: Those close to the couple say that Ms. Abedin, a seasoned operative well versed in the politics of redemption, has been a main architect of her husband’s rehabilitative journey, shaping his calculated comeback and drawing on her close ties with one of the country’s most powerful families to lay the groundwork for his return.

A surrogate daughter to Bill and Hillary Clinton who has seen firsthand the cleansing power of campaigns, Ms. Abedin has leapt into her husband’s effort, conferring on strategy and helping to hire staff members from her long history with the Clintons: Ms. Abedin worked with Mr. Weiner’s new 30-year-old campaign manager, Danny Kedem, during Mrs. Clinton’s 2008 presidential run.

Ms. Abedin considers the coming race an adventure, and she has even been willing to break her cherished status as a seen-but-not-heard insider. In Mr. Weiner’s rollout video, she appears prominently in the first and final frames, smiling with her husband and reassuring voters, “We love this city.”

“She seems to have jumped onboard with both boots,” Mr. Weiner said in an interview this week, a palpable pride in his voice. Ms. Abedin, he said, “has forgotten more about politics and public policy than I maybe will ever know.”

A fierce advocate for her husband, Ms. Abedin was among the final holdouts two years ago who insisted that Mr. Weiner hang onto his Congressional seat, even as the cascading scandal sent allies scurrying and prompted Democratic leaders, including Representative Nancy Pelosi and President Obama, to abandon him.

She married Mr. Weiner in 2010 at a ceremony where Mr. Clinton presided and the groom was teased about his future in Gracie Mansion. In recent months, she has been eager to end a difficult period of social exile during which she and her husband were virtually absent from the public eye — and Mr. Weiner’s access to influential circles was often tied to his wife’s close connections with the powerful world of the Clintons.

The couple live in a spacious Park Avenue apartment owned by a Clinton donor. And it was at a Clinton Global Initiative conference last fall that Mr. Weiner, who at the time was something of a recluse, made one of his few public appearances, drawing stares among the A-list invitees.

In late March, days before he revealed his interest in running for mayor, Mr. Weiner joined his wife and the Clintons in the Dominican Republic for a beach weekend with the fashion designer Oscar de la Renta, who owns a villa there. The former congressman mingled with a boldface crowd that included Mayor Michael R. Bloomberg and his girlfriend, Diana L. Taylor.

Video

Anthony D. Weiner, the former congressman who was forced from office after a texting scandal, re-emerged on New York's political stage when he appeared in the Bronx at a forum for mayoral candidates.Published OnMay 24, 2013

Mr. Weiner is both grateful and deeply protective of Ms. Abedin, who is often shielded from scrutiny by her allies in the Clinton world. In the interview this week, Mr. Weiner’s rat-a-tat cadence slowed as he described his wife as “an extraordinarily gifted and graceful person.”

On Thursday, he said that one thing he regretted missing in Congress was the chance to defend his wife from accusations lodged last year by Representative Michele Bachmann of Minnesota and other House Republicans, who suggested that Ms. Abedin may be tied to Muslim extremists.

“I couldn’t help thinking that, if I were there, in that chamber, Michele Bachmann and her like wouldn’t have done that type of thing,” Mr. Weiner told reporters after a campaign stop in Harlem.

Still, for Ms. Abedin, promoting her husband’s career is a mission with some peril: Bill and Hillary Clinton, who have all but adopted her as family, remain deeply wary of appearing close with Mr. Weiner, a tarnished, unpopular figure.

The Clintons, who said this week they would not support a candidate in the mayoral race, are loath to be linked to Mr. Weiner’s bid, according to interviews with more than a dozen people close to the couple who declined to be named for fear of upsetting those involved.

“They are not happy about it,” a longtime associate said.

In the interviews, many of those close to the Clintons can barely contain their dislike for Mr. Weiner, whom they speak of like a disapproved-of in-law, tolerated but unloved. And Mr. Weiner’s occasionally rocky rollout has brought its own tensions.

Mr. Clinton’s office was not told ahead of time that his family name was mentioned 21 times in a profile of Mr. Weiner and Ms. Abedin that ran in The New York Times Magazine, according to a person close to the family. (The piece was written by a journalist who had developed a rapport with Ms. Abedin while working on articles for Vogue about Hillary and Chelsea Clinton.)

Mr. Weiner’s return to Twitter in April coincided with Mr. Clinton’s debut on the social network — prompting a flurry of unwelcome chatter comparing the personal indiscretions of the two.

Several of the Clinton friends interviewed openly questioned whether Ms. Abedin could remain a top aide to Mrs. Clinton with Mr. Weiner in what is certain to be a rough race: in political circles, anonymity is often the mark of a successful aide, not the spotlight of being a political spouse.

For now, however, the Clintons and their allies are still closing ranks. When Ms. Abedin faced scrutiny this month about an arrangement that allowed her to earn money as a private consultant while still working as a top adviser at the State Department, Clinton aides were keenly sensitive about the matter and rushed to defend Ms. Abedin.

She fully intends to continue her work with Mrs. Clinton’s transition team, and Mr. Weiner has said her role on the campaign is still evolving.

In New York City, Ms. Abedin’s presence may have already paid dividends in attracting staff.

In the past few weeks, several political aides have been tempted to sign onto a Weiner mayoral campaign — although not necessarily because they believe he can win the race.

Instead, according to people familiar with discussions, the interest has stemmed from the ample access the job would provide to Ms. Abedin, who presumably would be involved in a presidential run by Mrs. Clinton in 2016.

A version of this article appears in print on , on Page A21 of the New York edition with the headline: A Wife With Powerful Ties Is an Unexpected Architect of a New York Comeback. Order Reprints | Today’s Paper | Subscribe