MOSCOW — He has ridden shirtless on a horse in Siberia, piloted a hand glider with migratory birds, swum with dolphins, tossed judo opponents, and dived into the depths of Lake Baikal and the Black Sea.
He was in Beijing for the “One Belt, One Road” initiative, a $1 trillion plan for infrastructure and economic development in some 60 countries. And while waiting at a state guesthouse for China’s president, Xi Jinping, Mr. Putin sat down at a grand piano and played two tunes: “Evening Song,” by Vasily Solovyov-Sedoi, and “Moscow Windows,” by Tikhon Khrennikov.
Both songs are from the late 1950s, when Mr. Putin, 64, was a child and the Soviet Union was emerging from the shadow of Stalin, who died in 1953.
The performance seemed casual, but it was clearly not spontaneous — a cameraman was on hand, and video of the impromptu recital quickly circulated on the Russian state news media.
The recital showed perhaps a softer side of Mr. Putin, an authoritarian leader who has been in power since 1999 and has often appeared eager to be seen as manly.
“Evening Song,” usually performed with lyrics by Aleksandr Churkin, was written in 1957 and is considered an unofficial anthem of St. Petersburg, Mr. Putin’s hometown, formerly known as Leningrad.
Here are some of the lyrics:
“The city over the free Neva, the city of our glorious labor, listen Leningrad, I am singing to you my heartfelt song.”
In the 1980s, fans of the St. Petersburg soccer team Zenit turned it into an unofficial anthem for the team.
The other tune, “Moscow Windows,” usually performed with lyrics by the poet Mikhail Matusovsky, is a tune about friendship. Some lyrics read:
“As in the past I am ready to stand under your window, and I always rush toward the rays of light coming out of it as to a date with my youth.”
Mr. Putin performed both tunes without a vocal accompaniment.
It was not the Russian leader’s first time playing music in public: He performed “Blueberry Hill” at a 2010 charity event attended by celebrities like the actors Sharon Stone and Gérard Depardieu in St. Petersburg, and “Moscow Windows” at a 2014 event at the Moscow Engineering Physics Institute.
Mr. Putin’s spokesman, Dmitri S. Peskov, told journalists in Beijing that “while Mr. Putin was waiting for a bilateral meeting with Xi Jinping, the president studied some papers, prepared for the meeting and also played piano,” as quoted by Gazeta.ru, a Russian news website.
Chinese propaganda chiefs did not appear to be amused that Mr. Xi had been upstaged to some extent at his own conference, and the official Chinese news media pointedly made little mention of the piano performance.
But Mr. Putin’s piano playing seemed to strike a chord with Chinese social media users. Female users posted notes online saying he was handsome. (Mr. Putin has long been popular among Chinese women as a symbol of manliness.) Other social media users were quick to suggest that their country’s leaders also had musical talent.
One user of Weibo, a popular Chinese microblogging site, posted one photograph of Mr. Putin, and six images of former President Jiang Zemin playing piano, a traditional Chinese flute, two kinds of traditional stringed instruments and even a Hawaiian guitar.
That Weibo posting had a single-word rebuff to Mr. Putin: “Ability.”