Will & Grace stars Eric McCormack and Debra Messa paid tribute to fans after the final episode of the revived sitcom aired in the US.

The groundbreaking comedy was the first prime-time TV series to feature openly gay lead characters on American terrestrial television and has been credited with shifting attitudes towards the LGBTQ community in the US. 

It starred McCormack as gay lawyer Will Truman and Messing as straight interior designer Grace Adler, with Sean Hayes and Megan Mullally appearing as friends Jack and Karen.

It originally aired from 1998 to 2006 and was rebooted in 2017 with all the original lead cast members. 

On Thursday, the final episode aired in the US and followed Grace as she prepared to give birth. 

After the final credits rolled, Messing shared a message on Twitter. She wrote: "The time has come! Thank you all for making these #WillandGrace years the most memorable ones. The Fab Four and all of you will always have a special place in my heart."

McCormack also shared his gratitude with fans. He tweeted: "Final bows... thank you to every single fan who's been there from day one and those who joined us for the reunion. We love you all... Stay tuned for the farewell retrospective special."

Will & Grace, created by Max Mutchnick and David Kohan, was a huge hit with viewers and critics during its original run, winning 16 Primetime Emmy Awards from 88 nominations.