Grammys: Carole King and Sara Bareilles Perform 'Beautiful,' 'Brave' Medley, Present Song of the Year (Video)

The album of the year nominee and the legendary singer-songwriter and 2014 MusiCares Person of the Year joined forces for a side-by-side piano duet.

Carole King and Sara Bareilles teamed up for a modified duet of Bareilles' "Brave," interspersed with lyrics from King's "Beautiful" at Sunday night's Grammy Awards.

The singer-songwriters played side-by-side pianos, facing each other. They both sang "Brave's" chorus, adding the lyric "I just want to see you be beautiful" for one rendition.

PHOTOS: 2014 Grammys Red Carpet Arrivals

The performance, which was introduced by Cyndi Lauper, began with King performing the opening lines of "Beautiful" before Bareilles took over with "Brave." King inserted more lines from that song into her duet with Bareilles before the final "Brave" chorus.

After their performance, King blew Bareilles a kiss and they joined each other in front of the pianos, putting their arms around each other. Bareilles also jumped up and down and squealed after performing with her icon.

"What a thrill to perform with the woman who has been such an inspiration to me," Bareilles said.

"And what a thrill to see the future of music in such good hands," King added.

FULL LIST: Grammys 2014 Winners

After Bareilles' noted that King won the song of the year Grammy in 1971 for "a timeless song called 'You've Got a Friend,'" King said, "I like her."

The duo then presented the song of the year Grammy to Lorde for "Royals."

King, who was named 2014's MusiCares Person of the Year, was previously honored at a star-studded benefit gala on Friday night. Bareilles was also among the performers at the L.A. convention center bash.

Bareilles went into the night nominated for two Grammys, including album of the year for The Blessed Unrest and best pop solo performance for "Brave."

The MusiCares Foundation offers programs and services, including emergency financial assistance for basic living and medical expenses, for member of the music community.

Friday's MusiCares benefit raised more than $5.5 million for the charity.