“We have to solve the problems of migrants in Europe, but we have to give them hope to live here as well,” he said.

Shortly before the concert, the desert silence was broken by a thud from a Russian demining center near the ruins.

Russia has a history of turning to classical music for morale in conflict, using talented artists to display its cultural strengths. It did in August 1942 when, during the Nazi siege of Leningrad, as St. Petersburg was then called, starving Russian musicians, supplemented by military performers, gave the city’s first performance of Dmitri Shostakovich’s Symphony No. 7, otherwise known as the Leningrad Symphony.

The concert on Thursday, like Mr. Gergiev’s 2008 concert in Tskhinvali, the capital of South Ossetia, involved much more than just music. While showcasing Russia’s musical richness, it was also a military mission, with guests bused in a heavily guarded convoy escorted by helicopter gunships. The route from Latakia, the site of Russia’s main military base on Syria’s Mediterranean coast, led past Syrian military outposts, destroyed villages, clusters of burned vehicles and other reminders of the fierce fighting that had raged in an area held by the Islamic State from May 2015 until March this year.

The concert, performed by Mr. Gergiev’s Mariinsky Theater Orchestra, was held just a week after Unesco experts had visited to assess the destruction inflicted by the militant group. They reported extensive damage to the city’s museum, where statues had been “defaced, smashed, their heads severed, the fragments left lying on the ground.” Also destroyed was an arch and the Temple of Baal Shamin, which the experts said had been “smashed to smithereens.”

Western governments have been reluctant to endorse Russia’s military role in Syria, which they have repeatedly portrayed as an effort to not merely uproot terrorism but to help Syria’s president, Bashar al-Assad, crush all opposition, including rebel groups supported by the West. Russia has also been accused of bombing hospitals, something Moscow denies, and propping up a brutal dictator.