It was his news conference, but it was hard to take your eyes off her.

With Huma Abedin’s emergence as her husband’s chief defender and protector in a second sex scandal, she made a public transformation from being the victim of Anthony Weiner’s transgressions to a full partner in his ambition.

Although those who know Abedin say they were surprised by how she seized the moment at his news conference Tuesday, rejecting humiliation for defiance, they note that she has been a major force in Weiner’s unlikely bid for redemption.

One friend said Abedin has known since last fall that her husband had not given up his habit of lewd behavior with women on the Web. Nevertheless, Abedin, a top aide to Hillary Rodham Clinton, has continued to aggressively work Clinton’s circle — to the annoyance of some — seeking support and financial contributions for Weiner’s mayoral bid.

“People like Huma, but they saw her trading on the Hillary card and resented it. But that didn’t mean they didn’t show up” for Weiner, said a Clinton intimate, one of several who spoke on the condition of anonymity. “The chatter was, if you wanted to stay in Hillary’s good graces, you answer the call from Huma.”

Even those who believed Weiner had no shot at winning were eager to stay on the good side of a woman they expect would be a major figure in a Clinton 2016 presidential campaign, should the former secretary of state decide to run.

But Abedin acknowledged a miscalculation, said the friend, who also spoke on the condition of anonymity.

When the exchanges became public Tuesday, the friend said, Abedin realized she had erred in thinking she could maintain some privacy by remaining vague about her marriage, most notably in a much-discussed New York Times Magazine profile that presented a gauzy view of a couple in recovery.

To correct that error, she decided she must stand by her husband’s side at the news conference — an appearance that evoked memories of the times that Clinton, her mentor, had been in similar situations as first lady of Arkansas and the United States.

A wronged spouse in her own right, Abedin gazed at her husband dolefully. She looked away. She stared at the floor. She attempted to smile.

When it came her turn to speak, she acknowledged she was nervous, then declared her love, her forgiveness, her support going forward.

“I do very strongly believe that that is between us and our marriage,” Abedin said.

But any possibility of maintaining that privacy ended in May, when Weiner announced he was running for a job that has long been his dream.

Others who have been in Abe­din’s spot — as American political wives going at least as far back as Alexander Hamilton’s have — say it is impossible to know what it is like until you have lived it.

“As a person and as a woman and as a wife, I’ve been through the painful reality of marriage with a troubled individual and having it in the press. My heart goes out to her,” said Jenny Sanford, who was married to then-South Carolina Gov. Mark Sanford (R) in 2009 when his infidelity erupted into a spectacular scandal.

Their marriage ended, but Mark Sanford’s political career did not. He was elected in May to a seat in the House.

Connie Schultz, a syndicated columnist, is married to Sen. Sherrod Brown (D-Ohio). Although their marriage has suffered no similar public trial, Schultz said: “I don’t see her as a victim. She chose to do this. We’re humiliated only if we agree to be humiliated.

“The so-called political wife is sort of a comical term to me. It’s not as if you order us from a catalogue,” Schultz added. “I liked it that she didn’t look helpless or defeated or gaunt. She looked strong in her own way.”

Abedin’s friend said that Weiner admitted to her in the fall that he had continued contacting women on the Internet, prompting her to react furiously and consider leaving him. She ultimately decided to stay for the sake of their young son, with whom she was pregnant in 2011 when the original scandal broke.

She has been an active force in Weiner’s political resurrection, campaigning for him publicly and trying to round up support for him privately.

On July 2, for instance, many Clinton supporters received an e-mail from Abedin with “Favor . . .” in the subject line.

“You probably never thought you’d receive an email like this from me, and I never imagined I would be sending a note to friends about a mayor’s race,” it began, before launching into an appeal for “our friends who care as much about this city as we do, to help as much as you can, however you can.”

Abedin, 36, who began working for Clinton in the late 1990s when she was first lady, enjoys enormous affection among those who are close to the Clintons.

“She has more friends than anyone I know — people who really, really love her,” said journalist and author Kati Marton, the widow of Richard Holbrooke, a close ally of Clinton who served as her troubleshooter in Afghanistan and Pakistan during her tenure at the State Department.

For years, Abedin was a continual presence at Clinton’s side as her traveling chief of staff. Abe­din’s poise and style led Vogue to feature her in a 2007 fashion spread headlined: “Hillary’s Secret Weapon.” The magazine also did a story on her 2010 wedding to Weiner, now 48.

Still, many of those who knew her were perplexed by her decision to marry Weiner, then a Democratic congressman whom they considered brash and narcissistic.

“Three years ago I was a single workaholic, traveling the globe with an amazing job at the U.S. State Department. I could not have imagined how much my life would change in three short years,” Abedin wrote in an essay published Wednesday on the Web site of Harper’s Bazaar.

“People have said many things about my husband — some nice, some not so nice. And that will surely continue,” she added. “Launching this campaign was not an easy decision for our family to make. Putting yourself out there comes with a cost.”

Horowitz reported from New York.