In many ways, Russia and Turkey are natural partners. Both feel slighted by the West. Both are nostalgic for past imperial glory. And both are ruled by governments pledging to restore the countries' former greatness.



When Turkish Prime Minister Recep Tayyip Erdogan arrives in Moscow for a two-day visit, it will mark the latest stage in a long courtship between once bitter rivals.



Officially, the volatile South Caucasus region and energy cooperation will top the agenda as Erdogan huddles with both Russian Prime Minister Vladimir Putin.



But the broader subtext of Erdogan's visit will be the deepening entente between Moscow and Ankara that has emerged in recent years after centuries of conflict.



Analysts say the development is natural for two ambitious countries located on the West's periphery, both politically and geographically.



"You can see convergence" between Russia and Turkey, says Bulent Alireza, director of the Turkey Project at the Center for Strategic and International Studies in Washington.



"Both are Eurasian countries. Both are on the outside. And both are trying to redefine their relationship with Washington."



Alireza says the Russo-Turkish relationship has "an energy backbone" that originated in the final years of the Soviet Union, when Moscow began delivering gas to Turkey. Since then, he says it expanded into diplomatic cooperation in the Middle East and the Caucasus.



Analysts dismiss fears in the West that this still developing relationship could turn into a full-fledged alliance. All the same, observers say the days appear to be over when Turkey -- a key NATO member state -- could be counted on to toe the Western line.



"Where this is problematic for the West is that the assumption that people had for many years -- that Turkey was automatically going to follow the policy line that the U.S., Europe, and NATO wanted -- is not the case anymore," says Nikolas Gvosdev, a Russia expert and professor of national security studies at the U.S. Naval War College.



"Turkey is pursuing a much more independent course these days. And unless it sees something is in its interests, it is not going to automatically assume that what Washington wants is what Ankara ought to do."



Hedging Their Bets



That became abundantly clear during Putin's visit to Ankara in August, when Turkey granted Russia's state-run natural-gas monopoly Gazprom use of its territorial waters in the Black Sea, where Moscow wants to route its South Stream pipeline to deliver gas to Eastern and Southern Europe.



In exchange, Gazprom agreed to build a pipeline across Turkey from the Black Sea to the Mediterranean.



The agreements advanced Turkey's longstanding goal of becoming an energy hub. But it also marked a severe blow to the European Union-backed Nabucco pipeline project, a Western effort to decrease Europe's energy dependence on Russian energy by transporting gas from the Caspian Sea area to Europe via Turkey.



Analysts say Turkey's move is easy to justify. The Nabucco project, chronically underfunded and continuously delayed, has been slow to get off the ground.



And while Turkey insists it hasn't abandoned its plans for Nabucco, it is also clearly choosing to hedge its bets by dealing with Moscow.



"Turkey is pursuing its own interests pragmatically," says Tabib Huseynov, head of the International Crisis Group's Baku office.



"The Turks see that there is no improvement on the Nabucco front. That is why they want to make sure they aren't putting all their eggs in one basket and just counting on Nabucco for their energy security. They also want to make sure other options are available."



During Putin's visit, Russian and Turkish energy companies agreed to form a joint venture to build electric power plants in Turkey.



Analysts say Russia's strategy in Turkey resembles its approach to Germany, where Moscow has enticed the country's business and political community with lucrative projects. One such example is a joint venture, forged during the same Putin visit last August, to build electric power plants in Turkey.



"What is interesting is the emergence in Turkey -- as you have had in Germany and elsewhere -- of a pretty consistent business lobby that has a stake in good relations with Russia, wants the trade and development to continue, and can survive changes in governments and politicians," Gvosdev says.



"So you have the possibility that you can lay the framework for pretty close relations."



Crowding Out The West



Those relations extend beyond energy and business ties as well. Russia played a key role in facilitating Turkey's decision last autumn to take the first steps toward restoring relations with Armenia, which were severed over the Nagorno-Karabakh conflict in the early 1990s.



The resolution of the long-standing Karabakh impasse remains high on Turkey's foreign policy agenda. While in Moscow, Erdogan is expected to ask Putin to take a more active role in pushing for a settlement in the territory, which is legally part of Azerbaijan but occupied and controlled by Armenia.



Ankara has long wanted Russia to pressure Armenia to reach a settlement with Azerbaijan, a close ally of Turkey. Russian Foreign Minister Sergei Lavrov is traveling to Armenia today, possibly to soothe -- or stoke -- anxieties in Yerevan that Turkey may be pushing for concessions from Armenia.



While Russia takes a proprietary interest in its South Caucasus neighborhood, it has been sanguine when it comes to Turkey's growing influence there. Analysts say, however, that Moscow is prepared to use Turkey to diminish the regional influence of the West, and particularly of the United States.



"For Russia, this is part of a strategy to squeeze out European and American influence from the South Caucasus. Russia wants to see Turkey's growing role as a counterweight to European and American influences in the region," Huseynov says.



Russia and Turkey are also converging on Iran, where both oppose Washington's tough line toward the Islamic Republic's nuclear program.



"Turkey wants to be a more powerful voice in Middle East affairs, and Russia wants to do the same," says Taylan Bilgic is a correspondent for the "Hurriyet Daily News" in Istanbul.



"Turkey's positions, especially this government's positions, on Middle East affairs has become contrary to the Washington line. This is also consistent with Russia's position."



A Spurned Suitor



The relationship still has its fair share of irritants. Ankara and Moscow remain competitors in the Balkans. Russia continues to support its traditional Orthodox Christian ally, Serbia, while Turkey backs the predominantly Muslim Bosniaks and Kosovo Albanians.



The Russian State Duma has also recognized as genocide the massacre of an estimated 1.5 million Armenians by Ottoman Turks at the end of World War I -- a highly contentious point with Turkey, which firmly rejects the classification.



Still, there is presently more that binds the two countries than divides them. Analysts say one of the key factors driving Turkey into Moscow's embrace was a sense that Ankara's longstanding bid to join the European Union is no longer being seriously considered.



Gvosdev says the "siren song" emanating from Moscow is that Turkey's EU bid was "a sort of pipe dream," and that Ankara should look north, rather than west, for opportunities.



"The Kremlin is seizing on the sense that Turkey is a spurned suitor of the West, or at least the European Union, and is trying to turn that to its advantage," Gvosdev says.



"Had the talks for Turkish accession to the European Union since 2003 been much more positive than they have, then you would see a lot less room for Moscow to move in. But the vacuum opened up, and Moscow is trying to fill it."



Not all observers see cause for alarm in the new Russo-Turkish entente. Alireza of the U.S. Center for Strategic and International Studies, for one, says Turkey's openness to Russia dovetails neatly with U.S. President Barack Obama's policy of "resetting" Washington's relations with Moscow.



"[Turkey] is trying to balance its relations with the United States, the Europeans, and the Russians -- not just in the energy sector, but also further afield," Alireza says.



"From the Turkish point of view, the ideal solution would be for Washington not to oppose what it is doing with Moscow, but perhaps to takes advantage of it, as it redefines its own relationship with Moscow away from a zero-sum game."