Pop star Ariana Grande released a new single shortly before ex-fiance Pete Davidson hit the stage on "Saturday Night Live."

In the song, called "Thank U, Next," Grande thanks her former boyfriends – including Davidson and Mac Miller, who died from a suspected overdose in September – for helping her learn and grow.

"Even almost got married / And for Pete, I'm so thankful / Wish I could say, 'Thank you' to Malcolm / 'Cause he was an angel," she sings in the first verse.

>> Listen to the song here (WARNING: Lyrics contain profanity.)

Grande referenced the song's title last week in a now-deleted tweet slamming Davidson after he appeared to joke about the pair's whirlwind romance and broken engagement in a "Saturday Night Live" promo.

"Hey Maggie, I'm Pete," he told musical guest Maggie Rogers in the clip. "Wanna get married?"

"No," Rogers said, to which Davidson replied, "0 for 3." (Davidson previously was engaged to Cazzie David, daughter of comedian Larry David, according to NBC News.)

>> Watch the promo here

In an apparent response to the clip, Grande tweeted, "For somebody who claims to hate relevancy u sure love clinging to it huh," adding, "Thank u, next."

During this weekend's "SNL" broadcast, Davidson addressed the split – and Grande's song – on "Weekend Update."

>> Read more trending news

"I know that 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," Davidson said. "She's a wonderful, strong person, and I genuinely wish her all the happiness in the world."

Moments later, he joked: "I'm still a great song, though."

>> Watch the clip here