As a girl, Lena Dunham always saw herself as one day becoming a mother.

In fact, the former “Girls” star revealed in a new essay for Vogue that her childhood fantasy about being a mother extended to also being pregnant. She said she would stuff her shirt “with a pile of hot laundry” and march around her family’s living room “beaming.” She also reveled in the “innate power of” pregnancy when wearing a prosthetic belly for “Girls,” when her character Hannah Horvath was pregnant.

But Dunham has revealed in her essay that this fantasy of growing a baby inside her will never become a reality. That’s because, at 31, she decided to have a total hysterectomy. She said she made this difficult choice following a decade of suffering persistent and sometimes agonizing pain and complex surgeries due to endometriosis.

Dunham has been open in the past about suffering from endometriosis, a disease in which the tissue that normally lines the inside of the uterus — the endometrium — grows outside the uterus, according to the Mayo Clinic.

In her Vogue essay, she said the pain became “unbearable” in August. When various conventional and alternative therapies didn’t bring relief by November, she decided it was time to have her uterus removed.

“With pain like this, I will never be able to be anyone’s mother,” she wrote. “Even if I could get pregnant, there’s nothing I can offer.”

The surgery involved removing both her cervix and uterus, she wrote. After the surgery, her doctors revealed that her uterus was “worse” than anyone could have imagined.

While Dunham wrote that, physically, she recovered “like a champ,” she also described her emotional roller-coaster from losing her uterus. Dunham said that she received support from her longtime boyfriend, Bleachers frontman Jack Antonoff, 33. Dunham and Antonoff disclosed in January that they had broken up after five years together, Page Six reported.

Dunham also wrote that she was surprised she wasn’t bitter or resentful about her many friends who are becoming pregnant or having children. She added that said her doctors would soon explore whether her ovaries contain eggs that she could presumably have fertilized and then be carried by a surrogate.

Dunham wrote that she consoles herself with the belief that she has “choices,” which include adoption. She said she never felt as though she had these choices when she was coping with the uncertainty that comes with endometriosis.

Then again, she wrote in Vogue that she still grieves the fact that she will never know what “nine months of complete togetherness could feel like.” She said, “I wanted that stomach. … I was meant for the job, but I didn’t pass the interview.”

But “that’s OK,” she wrote. “It really is. I might not believe it now, but I will soon enough.”

Martha Ross is a features writer who covers everything and anything related to popular culture, society, health, women’s issues and families. A native of the East Bay and a graduate of Northwestern University and Mills College, she’s also a former hard-news and investigative reporter, covering crime and local politics.