Shawn Mendes and Miley Cyrus teamed up to perform at the Grammy Awards on Sunday.

The duo, who took the stage together on Friday night as well at the MusiCares gala honoring Dolly Parton, performed Mendes’ hit “In My Blood.”

Mendes took the stage in the second performance of the night, playing the piano as he belted his Grammy-nominated track. He stood up and continued to play the song on his guitar before being joined by Cyrus. The two closed the performance with a hug.

Fans first speculated about the collaboration when Cyrus shared a photo Wednesday on Instagram of her at Grammy rehearsals. They quickly spotted Mendes’ guitar in the background, and what looked like his name written on another piece of equipment.

Mendes scored his first two Grammy nominations this year, for best pop vocal album for his self-titled collection, and song of the year for “In My Blood.” Cyrus’ “Bangerz” was nominated in 2015 for best pop vocal album.

Cyrus told Variety on Friday that she reached out to Mendes to set up the MusiCares collab, where they sang “Islands in the Stream,” via Instagram DMs.

“I actually sent him a DM and said, ‘I don’t know what you’re trying to do next,’ because I’ve actually been in his position in his career, too, before, where you’re someone who I think is trying to fit into pop music and you want to be played on pop music, but you don’t want to be conformist and you want to do your own thing,” Cyrus said. “I love the way that he always kind of plays alternative pop because it’s something that I love to do.”