Demi Lovato has been cast in the upcoming season of Will & Grace.

According to Entertainment Weekly, the American singer-songwriter and actress will play Jenny, a mysterious woman who ‘unexpectedly’ comes into the life of Will (Eric McCormack). She will appear in three episodes in 2020.

Earlier this year, the executive producers of Will & Grace confirmed that its 11th season will be its last. The show originally concluded in 2006 after its eighth season but returned for two more seasons in 2017.

Eric McCormack, Debra Messing, Megan Mullally and Sean Hayes all reprised their roles, and the show was met with continued critical acclaim. However, it failed to match the amount of viewers as the original run.

Max Mutchnick, David Kohan and James Burrows said in a statement: “We think of the Will & Grace [revival] episodes the way Karen Walker thinks of martinis — 51 is not enough, 53 is too many.

“That is why, after consulting with the cast, we all have decided this will be the final season of Will & Grace.”

George Cheeks and Paul Telegdy, NBC Entertainment co-chairmen, added: “When NBC had the opportunity to reconnect this amazing cast and creative team, we jumped at the chance.

“The impact and legacy of Will and Grace simply can’t be overstated, both as a true game-changer in the portrayal of the LGBTQ community and as one of the finest comedies in television history. A huge thank you to [creators] Max [Mutchnick], David [Kohan], Jimmy [Burrows] and a cast that is second to none for their brilliance over an incredible run.”

After the news became public, Hayes (Jack) wrote on Twitter: “For all “Will & Grace” fans, I am sharing the news that this is going to be our last and final season (which premieres this winter).

“To everyone who watched the first run and to everyone that encouraged this reboot, we did it all for you.

Demi hasn’t appeared in a television role since her four-episode stint as Dani on Glee between 2013-2014.

She has mainly focused on her music career. Her last studio album Tell Me You Love Me (2017) became her most critically-acclaimed work to date, and reached the top three on the Billboard 200. It spawned the dance-pop Sorry Not Sorry.

It was recently announced that the star will appear in the upcoming Netflix film Eurovision, which will also star Will Ferrell, Rachel McAdams, Pierce Brosnan, Dan Stevens. It will follow Icelandic singers Lars and Sigrit at the Eurovision Song Contest.

Related: Eric McCormack says he “wouldn’t get anywhere near” his Will & Grace role today.