As Ellen Pompeo prepares to exit "Grey’s Anatomy" after being on the show for 19 seasons, her former costar Patrick Dempsey is poking fun amid her announcement.

Dempsey, who played Dr. Derek "McDreamy" Shepherd, joked about exactly why she's leaving, during an appearance on "Jimmy Kimmel Live."

"She's leaving the show. I don't know if you heard, she got caught stealing Band-Aids from the set," the comedian commented in light of Pompeo's decision.

'GREY'S ANATOMY' STAR ELLEN POMPEO PENS GOODBYE NOTE TO FANS AFTER 19 SEASONS: 'ETERNALLY GRATEFUL'

"Did she really? Finally, they caught her," Dempsey jokingly responded.

Patrick Dempsey Ellen Pompeo on 'Grey's Anatomy'

As Ellen Pompeo prepares to exit "Grey’s Anatomy" after being on the show for 19 seasons, her former costar Patrick Dempsey is poking fun amid her announcement. (Getty Images)

"Can you imagine what she'd have in her house now from 19 seasons? A full hospital."

Patrick Dempsey Ellen Pompeo on set of 'Grey's Anatomy'

Despite Patrick Dempsey’s character being killed off in 2015, he opened up about the impact of "Grey’s Anatomy." (Getty Images)

Despite Dempsey’s character havoing been killed off in 2015, he opened up about the significance of "Grey’s Anatomy." 

"It's amazing, the power of that show and how long it's lasted and the impact it's had around the world," Dempsey added. "It's changed my life profoundly and my family's." 

ELLEN POMPEO'S 'GREY'S ANATOMY' ROLE WILL BE DRAMATICALLY REDUCED AS SHE JOINS HULU PROJECT 

The 56-year-old actor also revealed that he receives better attention at the hospital after starring in the medical drama series. 

Ellen Pompeo as Meredith Grey

Ellen Pompeo’s last episode will air in February 2023. Her goodbye note came a week after the show’s fall finale. (Bob D'Amico/Disney General Entertainment Content via Getty Images)

The "Enchanted" star additionally noted that people have confessed that the show inspired them to pursue a career as a doctor. 

"I've met them who have said it was because of the show," he explained. "They've gone through medical school, and now they're practicing. That's how long the show's been on. That's the greatest thing about the show."

Meanwhile, Pompeo took to Instagram Thursday to express her gratitude to the "Grey’s Anatomy" fans in an emotional goodbye note.

"I am eternally grateful and humbled by the love and support you have all shown me, Meredith GREY and the show for 19 seasons!" Pompeo posted along with a photo of her in front of a neon sign that says, "All you need is Love."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

She continued, "Through it all … none of it … would have been possible without the best fans in the world. You all are RIDERS and you all have made the ride so fun and ICONIC!!"

She also assured fans that she wouldn’t be a stranger at Grey Sloan Memorial.

"I love you madly and appreciate you right back," she added. "This isn’t your first time on the rollercoaster … you know the show must go on and I’ll definitely be back to visit. With a lot of love and immense gratitude XoE." 

CLICK HERE TO GET THE FOX NEWS APP

Pompeo’s last episode will air in February. Her note came a week after the show’s fall finale.

Fox News Digital's Brie Stimpson contributed to this report.