Girls star Lena Dunham has thanked fans for their support after she revealed she had undergone a total hysterectomy.

The actress and writer wrote about her decision to have the procedure - the surgical removal of the cervix and uterus - in an essay for Vogue magazine earlier this week.

In a lengthy essay, the 31-year-old explained she had decided on the operation after years of pain caused by endometriosis.

Following her reveal, she thanked fans on Instagram for the outpouring of support as she opened up about being "heart broken".

She wrote: "Your body failing you is a loss that's hard to explain and yet the amount of messages I've gotten from women in a similar predicament has been so overwhelming, loving and heartening."

In her original essay for Vogue she said she would also explore adoption.

She wrote: "I may have 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. Adoption is a thrilling truth I'll pursue with all my might."