Longtime Hillary Clinton ally Huma Abedin is revealing the moment her husband Anthony Weiner came clean on the lewd photo he accidentally shared on Twitter, igniting a major political scandal that ultimately helped derail the career of a once-promising Democrat. 

In an excerpt of her upcoming book "BOTH/AND: A Life In Many Worlds" published by Vogue, Abedin recalled a 2011 text she received in the middle of the night from Weiner, who was in New York as she was in Washington D.C., which read, "My Twitter was hacked and someone posted a photo. There might be a story, but I am working on fixing the problem. Nothing for you to worry about. See you soon."

ANTHONY WEINER SCANDALS: FROM POLITICS TO SEXTING CASES

"He told me not to worry, so even though the concept of being hacked was unsettling, I didn’t," Abedin wrote. "I just saw this as yet another item on the unending stream of incoming. Anthony was the problem solver in our relationship, and since he said he was handling this one, I was sure he would."

Anthony Weiner, right, and Huma Abedin are seen in court, Wednesday, Sept. 13, 2017 in New York. The couple appeared before a New York City judge to ask for privacy in their divorce case. (Jefferson Siegel/The Daily News via AP, Pool)

Anthony Weiner, right, and Huma Abedin are seen in court, Wednesday, Sept. 13, 2017 in New York. The couple appeared before a New York City judge to ask for privacy in their divorce case. (Jefferson Siegel/The Daily News via AP, Pool) (AP)

Abedin then became alarmed upon her arrival to New York where Weiner, then a congressman, was not there to meet her at baggage claim as usual but was waiting in the car outside. 

"He had predicted correctly that there might be news. That morning the New York Post reported that an indecent image of a man wearing gray boxer briefs had popped up on Anthony’s Twitter feed before being quickly deleted," Abedin wrote. "I felt violated, angry for him, but also confident that he would get past it. HRC had been falsely accused of all kinds of nefarious acts, so scandal based on even the wildest of fabrications wasn’t exactly new territory for me."

ANTHONY WEINER SENTENCED TO 21 MONTHS IN PRISON IN TEEN SEXTING CASE

Days later, after Weiner had repeatedly pushed the hacking narrative to the press, Abedin recalled waking up alone in bed during a visit to a friend's house where the two of them had been staying. 

"When I woke up the morning of our departure, alone in bed, I realized that Anthony had never joined me in the bedroom. I walked past the small guest room at the end of the hall and noticed that the bed there had been slept in. I walked down the stairs and found Anthony standing in the door frame with his head down, bags laid at his feet. Not in. Not out," Abedin recalled. "'What’s wrong?' I asked. And then, just like that, life as I knew it was officially over. ‘It’s true,’ he said. ‘I sent the picture.’"

Huma Abedin attends 'The Beguiled' screening in New York City, U.S. June 22, 2017. REUTERS/Brendan McDermid - RC128BA19EF0

Huma Abedin's first cousin, Omar Amanat, was convicted of fraud on Tuesday and could face over a decade in prison. (Reuters)

"Anthony opened his mouth to speak and, as though a dam wall burst, words came flooding out. He said that he couldn’t stand lying anymore. His body shook as he tried to choke back tears. Over the next few minutes, he admitted he had intended to send the picture as a direct message with someone he had befriended over Twitter, but accidentally posted it publicly and deleted it (but not before someone had screen-grabbed it), that it had been a tawdry joke, a dare, it didn’t mean anything and he was ashamed and embarrassed and sorry that he had brought this upon us. I felt something explode inside my chest, and suddenly it was hard to breathe. I was simultaneously filled with rage and stunned to my core. It felt like a bolt of lightning had struck me and run straight through my body. That bolt was the only thing keeping me standing upright," Abedin wrote. 

ANTHONY WEINER RELEASED FROM HALFWAY HOUSE AFTER HE WAS SENTENCED FOR SEXTING TEEN GIRL

She continued, "Whatever personal pain and betrayal I felt, I instinctively set aside. I didn’t break down in tears or collapse on the sofa. The first thing out of my mouth wasn’t ‘How could you do this to me?’ or ‘I thought that you loved me.’ The first thing I said was, ‘You mean you’ve been lying to the whole world for a week?? Anthony, you have people counting on you. You owe them the truth!’ ‘I know,' he said. ‘I have to go back and deal with the consequences.’"

New York mayoral candidate Anthony Weiner and his wife Huma Abedin attend a news conference in New York, July 23, 2013. REUTERS/Eric Thayer/File Photo TPX IMAGES OF THE DAY - RTX2NHP1

New York mayoral candidate Anthony Weiner and his wife Huma Abedin attend a news conference in New York, July 23, 2013.   REUTERS/Eric Thayer/File Photo     TPX IMAGES OF THE DAY      - RTX2NHP1 (REUTERS)

Abedin suggested she "would have walked out on him then and there" if he admitted he was having an affair but regarded his actions at the time as "something infuriating, deeply inappropriate, juvenile, crass, and stupid, but not something that fundamentally altered our relationship."

The excerpt goes on to detail the stress she underwent as the New York Times was about to run a story about her pregnancy and how she didn't want her boss, then-Secretary of State Clinton, to know but that her longtime press adviser Philippe Reines "clearly" had told her, who offered her congratulations to Abedin. 

CLICK HERE TO GET THE FOX NEWS APP

Abedin's memoir will be released Nov. 2. Clinton is set to join Abedin on her book tour next month.

In 2017, Weiner was sentenced to 21 months in prison after he was caught sexting with a 15-year-old girl. He was released after serving 18 months.