Click to email this to a friend (Opens in new window)

Click to share on Twitter (Opens in new window)

Click to share on Facebook (Opens in new window)

Lena Dunham went from the Met Gala to the emergency room on Monday night, sources said, as other stars partied into Tuesday morning.

Before Anna Wintour’s fashion ball, the “Girls” creator posted pics of herself at home prepping — including a makeup-free photo in the bathroom and another one of her emerging glamorously in a custom Elizabeth Kennedy frock.

She later added playful shots on the red carpet including one captioned “fatal attraction,” featuring her lurking behind pop heartthrob Joe Jonas.

A source told Page Six Dunham’s next stop was unfortunately the hospital.

The actress had to leave the gala when she suffered a medical issue, but was thankfully released after a series of tests.

The HBO star’s been very open about suffering from endometriosis, which occurs when tissue grows outside the uterus. And she’s become a foremost advocate for awareness of the illness.

In a 2015 piece, “The Sickest Girl” for Lenny Letter, Dunham detailed her “long-term chronic infection.”

She’s also posted pics of herself in the hospital, and showed off her “endo scars” in a bikini.

Last month, she told readers she was endometriosis-free after a fifth surgical procedure. “My surgery went off without a hitch,” she wrote. “There was no endometriosis left. Between my surgeries and hormonal intervention, I was disease-free. That doesn’t mean it can never return, but for now, once my sutures have been removed and my bruises have changed . . . I will be healthy.”

A Dunham pal told us the latest incident stemmed from her battle with the disorder.

Despite any Monday setback, Dunham reveled in seemingly good spirits on the red carpet. She wore a Planned Parenthood pin and platform combat boots, and posed with Judd Apatow.

Last year, Dunham slammed the gala as “the Metropolitan Museum of Getting Rejected by Athletes.” She was seated next to Odell Beckham Jr. and recalled, “He looked at me and he determined I was not the shape of a woman by his standards . . . He was like, ‘That’s a marshmallow.’ ”

She later apologized.

Dunham’s rep had no comment.