In the winter of 2012, when the civil war in Syria had already consumed tens of thousands of lives, Vladimir V. Putin, the Russian president, sounded dismissive of Syria’s beleaguered leader, Bashar al-Assad, and unconcerned about his future. Mr. Assad, he said, acidly, had spent more time courting leaders in European capitals than he ever had in Moscow. “We are not that preoccupied with the fate of Assad’s regime,” Mr. Putin said then.
Three years later, the two presidents have bound themselves together in an alliance that reflects not only the urgent priority of salvaging the crumbling central government in Syria, but also each man’s eroded standing on the international stage.
Mr. Putin’s military has forcefully intervened to shore up Mr. Assad’s government in its struggle against an array of insurgents, but, even as Mr. Assad flew secretly to Moscow on Tuesday night for a meeting to assess the fighting in Syria, the chilly personal relationship between the two men has not changed, according to officials, diplomats and analysts
By all accounts, the two leaders remain distant and wary of each other. The Kremlin in particular has been frustrated by what it sees as Mr. Assad’s arrogance and, at least until recently, his unwillingness to bend to Russia’s wishes, on issues like jump-starting peace talks in Moscow this year and freeing dissidents who might play a role in any political solution.
“It’s not personal, this whole thing,” Dmitri Trenin, the director of the Carnegie Moscow Center, referring to Mr. Putin’s intervention. The highest priority of the Russians, he said, has been saving the central authority of the Syrian state as much as Mr. Assad himself in hopes of stemming the spread of chaos and, with it, the fertile ground in which the Islamic State can take root.
“To them, Assad is not a sacred cow,” Mr. Trenin added. “The issue to them is to save the Syrian state, to prevent it from unraveling the way Libya unraveled, Yemen unraveled.”
That has given hope to those who want to see a negotiated end to the war in Syria and hasten the departure of Mr. Assad himself — something Mr. Putin has signaled he is prepared to accept, even as Russia has continued to lend diplomatic and now direct military action to support Mr. Assad’s government.
Others, though, remain skeptical.
“Not being wedded to Assad does not mean that they’re prepared to negotiate a way for him to go,” said a senior administration official in Washington who, like other officials in this article, spoke on the condition of anonymity per government protocol.
Mr. Assad’s visit to Moscow — reportedly aboard a Russian military aircraft and unannounced until he returned to Damascus — underscored how deeply dependent he now is on the assistance he is receiving from Russia and Iran, help that is showing signs of shifting the momentum on some fronts inside Syria but is far from enough to bring the war to a decisive end.
It was Mr. Assad’s first trip outside Syria since the civil war began in 2011 and his first to Moscow since 2005, reflecting his embattled position and international isolation after a period in which he was courted as a would-be reformer after taking over after the death of his father, Hafez al-Assad, in 2000.
Russia — and the Soviet Union before it — had deep ties with the elder Assad’s government, dating to the Cold War, but the relationship waned in the 1990s as Russia struggled in the post-Soviet era. It continued to fade in the 2000s, when Mr. Putin and Mr. Assad rose to power almost simultaneously.
Both were unexpected successors — Mr. Putin emerged from his relative obscurity in Boris N. Yeltsin’s Kremlin and Mr. Assad because his brother, Bassel, had been their father’s presumed heir until his death in a car accident.
Despite such similarities, the two have strikingly different backgrounds and temperaments that have precluded a close bond, the officials and analysts said, even as the events in Syria and beyond have forced them together. Mr. Assad, the awkward son of an authoritarian leader, was an ophthalmologist practicing in London groomed to take over a regional power; Mr. Putin, a former intelligence officer, took over a weakened Russia and has since sought to restore its former power and prestige.
“There’s not much chemistry in the relationship,” said one long-serving Western diplomat in the region.
Mr. Trenin, of the Carnegie Center, described Mr. Putin’s relationship with Mr. Assad as based on coinciding interests as much as ideology or values. Until Tuesday night, Mr. Putin had not met his Syrian counterpart since his 2005 visit to Moscow, though Dmitri A. Medvedev, who temporarily succeeded Mr. Putin as president for four years, traveled to Damascus in 2010.
The secret planning for Russia’s military operations, the officials and analysts said, took place on the functional level between the militaries and intelligence agencies, which have maintained contacts throughout the war because of longstanding arms deals and the Russian naval presence at the Mediterranean port of Tartus.
“It is now an alliance, and a fighting one,” Mr. Trenin said. “Still, it remains essentially transactional, rather than values-based or strategic.”
Mr. Putin’s primary goal in Syria, as he laid it out in remarks at the United Nations last month, has been to prevent the toppling of another sovereign state in the Middle East by what he considers foreign interference, led by the United States.
A secondary purpose, though, has been to reassert Russia’s re-emergence as a crucial player in the Middle East and beyond, forcing through military action an easing of the diplomatic isolation imposed on Mr. Putin after events in Ukraine. Whether he can do that with his embrace of another ostracized leader remains to be seen.
In brief remarks in Moscow, released on Wednesday after Mr. Assad’s departure, the two leaders promised to pursue “a long-term settlement, based on a political process that involves all political forces,” as Mr. Putin put it.
At the same time, they emphasized their united front against terrorists, which is how both characterize not just the Islamic State but all armed opponents of Mr. Assad’s government. And they said that a political solution was only possible after success on the battlefield, which neither defined, leaving the timing of any negotiations entirely unclear.
The question now is whether Mr. Putin can press Mr. Assad to accept a negotiated end to his rule. “Putin’s influence over Assad is like Obama’s over Netanyahu,” a diplomat based in Syria told a group of colleagues several months ago, before the Russian military intervention began, referring to the often truculent relationship between the American and Israeli leaders.
Mr. Assad has, in fact, proved at times to be a reluctant partner in Russia’s efforts to end the conflict. He has stood up on many occasions to the Kremlin, to the extent that diplomats and analysts say it has irritated Mr. Putin.
“I think they know how confused the Assad regime is, and they’re frustrated by it,” said Andrew J. Tabler, an expert on Syria at the Washington Institute for Near East Policy who has followed the conflict closely, referring to the Russians.
He and others noted Russia’s efforts in January and April to broker talks in Moscow between Mr. Assad’s government and some of the armed groups rebelling against it. Those were coordinated by the Ministry of Foreign Affairs and headed by Vitaly V. Naumkin, director of the Institute of Oriental Studies of the Russian Academy of Sciences.
Mr. Assad’s representative, Bashar al-Jaafari, showed little flexibility in those talks, refusing to agree to confidence-building measures Moscow wanted, such as releasing political prisoners who might take part in a political solution.
The talks suggested the limits of Russia’s influence — even Mr. Putin’s. In 2012, Abdelaziz al-Khayer, a Syrian dissident, disappeared immediately upon returning to the country from China to participate in talks that were endorsed by Moscow. Diplomats and opposition figures have long said he was arrested by Mr. Assad’s security forces.
A Western diplomat recalled approaching his Russian counterpart to ask if Russia could pressure the Syrians to release him. “What do you think I’ve been doing?” the Russian diplomat responded.
Last year, another dissident, Louay Hussein, was arrested just before he was preparing to attend talks the Russians had organized in Moscow. He remained in prison for months, and came out declaring that he would no longer remain inside Syria trying to change the system from within. He had learned, he said, that Russia was unable, and Iran unwilling, to push Mr. Assad to any meaningful negotiations.
“From the first day I was arrested, the Russian ambassador was asking for my release,” Mr. Hussein said. It was to no avail; he said he believed it was Iran that ultimately succeeded in pressing for his release.
After the failure of those talks, Mr. Putin summoned Syria’s foreign minister, Walid al-Moallem, to Moscow in late June, for a meeting that was described as tense. It was then, evidently, that Mr. Putin began laying the groundwork for the military intervention. That appears to have given him far more leverage over Mr. Assad, something analysts said could weaken Mr. Assad’s standing at home by emphasizing his junior status to Mr. Putin.
Officials in Europe and the United States have warned that Russia’s intervention makes a political resolution even more remote. Whatever Mr. Putin’s personal feelings for the Syrian leader, he has made it clear that Russia’s immediate goal is shoring up the central government; he has yet to signal what might follow.
The Kremlin’s spokesman, Dmitri S. Peskov, declined on Wednesday to say whether the two leaders had discussed Mr. Assad’s political future.