Pop star Ariana Grande released a surprise single in which she name-checks ex-fiancé Pete Davidson just minutes before the comedian was to take the stage for the evening’s episode of “Saturday Night Live."

Grande’s new song, “Thank U, Next,” comes just days after the singer responded on Twitter after Davidson joked about their breakup during a promo for this week’s episode.

“For somebody who claims to hate relevancy u sure love clinging to it huh,” Grande wrote before following up with, “thank u, next.” Both tweets were subsequently deleted.

The new song refers to the singer’s other exes such as rapper Big Sean, Ricky Alvarez and the late rapper Mac Miller in its opening lines.

"Thought I'd end up with Sean but he wasn't a match / Wrote some songs about Ricky now I listen and laugh / Even almost got married and for Pete, I'm so thankful / Wish I could say, ‘Thank you’ to Malcolm 'cause he was an angel."

Grande and Davidson announced their breakup Oct. 14 after a four-month engagement. A source told Fox News their breakup appeared to be imminent after Miller died Sept. 7 of a suspected overdose.

Saturday’s show twice addressed the couples’ headline-making breakup.

During a sketch with guest actress Candice Bergen, the “Murphy Brown” star ordered a drink called a Pete Davidson. As to what kind of drink it was, Bergen quipped: “All I know is it’s got a lot going on, but it still gets the job done.”

During a later appearance on the show's "Weekend Update," segment, Davidson addressed the breakup directly.

“I know some of you are curious about the breakup, but the truth is, it’s nobody’s business, and sometimes things just don’t work out, and that’s OK. She’s a wonderful, strong person, and I genuinely wish her all the happiness in the world," he said. “Now please go vote on Tuesday.”

Fox News' Ryan Gaydos contributed to this report.