Debra Messing, who played Grace Adler for 8 seasons on the NBC comedy Will & Grace, says the show's producers initially kept Will's sexuality ambiguous.

Will & Grace is considered television's most successful series with leading gay characters. The sitcom received 83 Emmy Award nominations and earned 16 during its entire run.

But in an interview with HuffPost Live, Messing, 45, explained that NBC “wanted this show to have legs and they knew they would have to capture the audience's heart through laughter first.”

“I remember the opening scene of the pilot, when Will and I are on the phone talking about George Clooney and how we both find him handsome,” Messing told host Ricky Camilleri on Wednesday. “The way it was written was so subtle.”

“They did testing afterwards, and half the audience didn't realize after the pilot that Will was gay,” she said.

This was “considered a good thing for the show,” Messing said.

On the show's response: “We got just as many letters of hate as we did of love. But the beautiful thing is that the scales tipped very quickly.”

In 2003, Messing won the Emmy Award for Outstanding Lead Actress in a Comedy Series for her role on Will & Grace.