Girls creator and star Lena Dunham has revealed she underwent a total hysterectomy in recent months due to the years of chronic pain she has suffered from the gynaecological condition endometriosis.

Dunham has shared her story in an essay for the March issue of Vogue magazine entitled The Painful Truth, excerpts from which have been published on the Endometriosis Foundation of America's website.

The foundation says: "Endometriosis occurs when the tissue that lines the uterus (endometrium), is found in regions outside of the uterus, in other words, where the tissue should not be." The condition results in chronic inflammation and pain. 

In her essay, Dunham says the decision to undergo elective surgery followed "years of complex surgeries measuring in the double digits" and various types of therapy for endometriosis. 

Last May, Dunham was rushed to hospital from the Met Ball in New York because of complications from surgery the previous month. The 31-year-old subsequently underwent further surgery.

Writing in her Vogue essay of her desire to have children, Dunham recalls that "As a child, I would stuff my shirt with a pile of hot laundry and march around the living room beaming. 

"Later, wearing a prosthetic belly for my television show, I stroke it subconsciously with such natural ease that my best friend has to tell me I am creeping her out."

Looking to the future, Dunham says she "felt choiceless before, but I know I have choices now".

"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 continues. 

"Adoption is a thrilling truth I'll pursue with all my might."