It was a gesture that ended a crisis. The leaders of Russia and Turkey met on Tuesday to shake hands and declare a formal end to an eight-month long war of words and economic sanctions.

But, as Vladimir Putin greeted his Turkish counterpart in the gilded hall of a St. Petersburg palace, I got the distinct impression that Ankara wants this reconciliation the most.

There was the handshake, yes. But Mr Putin's smile looked thin and he was hardly oozing warmth even by his own restrained standards.

Recep Tayyip Erdogan by contrast talked repeatedly of his "dear friend" Mr Putin - five times, according to one report. I lost count. He also pledged that relations with Russia would return not just to their pre-crisis level, but even higher.

The next day one newspaper here described Mr Erdogan as acting as if nothing bad had ever happened. To me, his enthusiasm implied the opposite.

Image copyrightHaberturk TV Channel via European Photopress AgencImage caption
Relations between the two countries have been strained since Turkey shot down a Russian warplane in November

Moscow's reaction at the time was furious. Mr Putin lashed out, accusing Ankara of stabbing Moscow in the back. The offence was even greater, coming from a supposed friend. Rebuilding real trust will be hard, perhaps impossible.

Russian public opinion has also turned since November. For months, state-controlled media conducted a staggering, all-out offensive against Ankara. All of a sudden, it seemed like Turks were to blame for everything.

Most serious were accusations from top officials that Mr Erdogan's own family has profited from an illegal trade in oil from areas of Syria controlled by the so-called Islamic State. He's denied that emphatically.

But in St. Petersburg came the official message that it's time to move on.

Image copyrightEPAImage caption
Putin voiced support for Turkey's elected authorities in the wake of July's attempted coup

After all, this meeting only happened because Mr Putin got the apology he demanded from President Erdogan. Russia could claim a victory of sorts.

There is also an economic motive. Russian sanctions have hit hard - particularly the ban on charter flights, which usually carry several million Russian tourists to the Turkish coast each year. The number has slumped by almost 90%.

As for Russia, tour operators and charter companies here will certainly be relieved when flights eventually resume. They're banking on a late-season rush to the Mediterranean.

And even this week, state TV has been predicting cheaper fruit and vegetables once Turkish agricultural imports are permitted again. "Tourists that way, tomatoes back here," as a report in Vedemosti newspaper phrased it.

But the visit also had additional political value for Moscow. Ankara is angry with the West for what it considers a weak response to the attempted takeover. Add to that its long-standing grudge at the snail's pace of talks to join the EU and step in Mr Putin - who is keen to capitalise on the chill and chip away at Turkey's ties with the West.

The Russian leader certainly won bonus points with Ankara for calling in support of the elected authorities after the attempted coup. Mind you, that's a given for Moscow which has its own deep-seated fear of regime change.

So the summit at this glitzy, seaside palace allowed Russia and Turkey to present what one analyst described to me as an "alliance of misfits": two countries that feel rejected and mistreated by the West, joining forces.

Still, despite the public display of reconciliation, the two still have major differences.

The key one is Syria, where Moscow has recently been casting itself as peacemaker but where Russia and Turkey back opposite sides. It could be telling that after almost three hours of initial talks, the two presidents told a press conference that they hadn't even touched on the topic.

Turkey's president deliberately avoided answering a question on their differences, while Mr Putin chose to underline them. There is no clear consensus on where they can seek common ground on Syria.

But after months of open hostility - and given the potential for utter disaster when Nato member Turkey shot down that Russian fighter jet - it is surely better that the two leaders are at least talking again.