“Rain down freedom until we’re all free” sang Legend, who also accompanied by a gospel choir, as images of those affected by the conflict played out on screens behind him.
At the end of the track, viewers were given the details of a charity helping Ukrainian refugees.
Prior to Legend’s performance Mr Zelensky asked: “What’s more opposite to music?… The silence of ruined cities and killed people.
“The war doesn’t let us choose who survives and who stays in eternal silence,” he added, but spoke of his country defending its freedom “to live, to love, to sound”.
He signed off his video message by saying he hoped his countrymen and women could soon “be free like the people on the Grammy stage”.
Since the conflict began in February, many Ukrainian musicians, producers and DJs have joined the fight against Russia, and also found themselves acting as war reporters and military fundraisers.