Demi Lovato will return to her acting roots in the last season of NBC's "Will and Grace," a revival of the groundbreaking sitcom about two best friends, Will Truman, a gay lawyer, and Grace Adler, an interior designer.

The "Sorry Not Sorry" singer had been teasing the news on Instagram for days, telling her followers that she was working on a "secret project," but Tuesday she officially announced the news with a picture of her sitting on the show's set.

"Will & Grace & Demi," the pop star wrote in the caption.

Lovato will guest star as Jenny, "a guarded girl who comes into the life of Will (Eric McCormack), in three episodes of the sitcom in 2020, according to a spokesperson for NBC.

Debra Messing, who plays Grace, expressed her excitement over having Lovato on board in the comments section of the singer's post.

"DEMIIIIIIIIIIIIIIIIII!!!!!!!! You are so sweet. I am so happy you came to play with us! You are now officially part of the family," Messing wrote.

McCormack and Sean Hayes, who plays Jack, also shared their own photos with Lovato on set.

“Demi Lovato fitting in perfectly here at W&G,” Hayes wrote on Instagram.

In July, NBC said that the rebooted sitcom will wrap up after its upcoming 2020 season, with the air date to be announced. The third and final season will include 18 episodes.

Lovato was nominated for "Best Dance Video" at this year's MTV Video Awards for her "Solo" video with Clean Bandit, but ultimately The Chainsmokers and Bebe Rexha won the award for "Call You Mine."

The 27-year-old singer has had an illustrious music career, with six studio albums under her belt, but she first broke into the industry with an acting gig on "Barney & Friends," alongside Selena Gomez, followed by numerous shows and movies on the Disney Channel.

Follow NBC Latino on Facebook, Twitter and Instagram.