Lena Dunham reveals why she underwent a hysterectomy at age 31

The "Girls" creator has been vocal about her long battle with endometriosis.

In a first-person essay featured in the March issue of Vogue, the 31-year-old "Girls" star and creator wrote that she made the tough decision to have her uterus and cervix removed after a decade of grappling with pain from endometriosis and nine previous surgical procedures.

Dunham wrote that the pain had become "unbearable" in August and after trying "pelvic-floor therapy, massage therapy, pain therapy, color therapy, acupuncture, yoga," she checked herself into the hospital and announced, "I am not leaving until they stop this pain or take my uterus."

The doctors then spent the next 12 days making sure that Dunham was sure about her decision to have the elective procedure, she said.

Once out of surgery, Dunham learned about the true physical state of her uterus and other reproductive organs.

"I wake up surrounded by family and doctors eager to tell me I was right. My uterus is worse than anyone could have imagined," she wrote. "In addition to endometrial disease, an odd humplike protrusion, and a septum running down the middle, I have had retrograde bleeding, a.k.a. my period running in reverse, so that my stomach is full of blood. My ovary has settled in on the muscles around the sacral nerves in my back that allow us to walk. Let’s please not even talk about my uterine lining."

She added, "The only beautiful detail is that the organ -- which is meant to be shaped like a lightbulb -- was shaped like a heart."

Dunham has been outspoken about her battle with endometriosis and in February 2016 took time off to deal with the illness.

In her essay for Vogue, Dunham stated that she is still determined to have children and is already looking into her options.

"I may have felt choiceless before, but I know I have choices now," wrote the actress, who recently split from longtime boyfriend Jack Antonoff. "Soon I’ll start exploring whether my ovaries, which remain someplace inside me in that vast cavern of organs and scar tissue, have eggs."

She added, "Adoption is a thrilling truth I’ll pursue with all my might."

Dunham's essay appears in the March issue of Vogue, available on newsstands on 2/20.