Playwright Larry Kramer and longtime partner David Webster married Wednesday in New York City.

According to The New York Times, the ceremony took place in the intensive care unit of NYU Langone Medical Center, where Kramer was recovering, surrounded by two dozen friends and relatives.

Kramer, who is 78, had been diagnosed with a bowel obstruction that required surgery.

“I had been traveling when Larry went into the hospital,” Webster said, “and when I was back and he was able to talk, he told me he had invited 20 people to the I.C.U. for the wedding. So it turned into a little party at his bedside.”

The men had originally planned to be married on the terrace of their Greenwich Village apartment.

Kramer is best known for his AIDS activism and for writing the Tony Award-winning play The Normal Heart, which is being adapted into a movie for HBO.

Webster, a 67-year-old architect, told the paper that Kramer had resisted marriage, calling such unions “feel-good marriages” because the Defense of Marriage Act (DOMA) prohibited federal recognition. But after the Supreme Court struck down DOMA last month, Webster said, Kramer dropped his opposition.