Will & Grace was ultra meta Thursday night (March 8), when guest actress Jennifer Lopez brought her Shades of Blue character, Harlee Santos, to the recently-rebooted NBC series.

In the episode titled "Sweatshop Annie & the Annoying Baby Shower," Lopez—as Jennifer Lopez—plays her Shades of Blue (another NBC show!) character while filming an episode for the police drama... which apparently is a TV show within the Will & Grace universe.

Jack (Sean Hayes), meanwhile, who was hired to play the role of a corpse, keeps interrupting the scene, asking Lopez if she remembers him.

This wasn't the first time Lopez made an appearance on Will & Grace, of course.

Back in 2004, the pop star played herself in a number of episodes, and even performed her hit song, "Waiting for Tonight," with Jack by her side as a background dancer. (Hence why he keeps asking her if she remembers him after all these years!)

Meanwhile, Will & Grace has seen dozens of celebrities make cameos (either as themselves or other characters) on the show over the years. Check out twelve pop icons who made guest appearances on Will & Grace, below:

More From 96.5 KVKI