The 29-year-old Girls star was rushed to hospital Saturday (March 5) after an ovarian cyst rupture.
Dunham will remain in hospital while she undergoes the surgery to treat the rupture.
Her rep, Cindi Berger, spoke to People: "Lena Dunham has been very public with her personal bouts with endometriosis. This morning, she suffered from an ovarian cyst rupture and has been taken to the hospital."
She adds: "Lena will be undergoing surgery at an undisclosed hospital. We thank you for you understanding and hope that Lena's privacy will be respected."
In February Dunham took to Facebook to update fans on her health struggles.
"I just wanted to let you know that, while I am so excited for Girls to return on Feb 21, I won't be out and about doing press for the new season. As many of you know I have endometriosis, a chronic condition that affects approximately 1 in 10 women's reproductive health. I am currently going through a rough patch with the illness and my body (along with my amazing doctors) let me know, in no uncertain terms, that it's time to rest.
That's a hard thing to do, but I'm trying, because all I want is to make season 6 of Girls the best one yet. I'm lucky enough to have support and backup from Jenni, Judd and the whole Girls gang. So many women with this disease literally don't have the option of time off and I won't take it for granted.
Wishing you all health & happiness, in whatever form suits you.
Back soon "
It's unclear how long Dunham will stay in hospital for.
Caitlyn Jenner: I get more flak for being Republican than for being transgender
Caitlyn Jenner meets Hillary Clinton and trans protesters in I Am Cait Season 2 trailer