A gunman shot Andrey Karlov, Russia's ambassador to Turkey, at a photo exhibition in Ankara on Monday. Karlov's condition was not immediately known. Initial Turkish media reports claimed the assailant, before he was "neutralized" by police officials, shouted out that his actions were retribution for Russia's role in the offensive in the Syrian city of Aleppo.

The attack is just the latest shooting incident in Turkey, which has endured a spate of terror strikes orchestrated by suspected Islamists as well as Kurdish separatist factions.

It signals a worrying moment for Turkish-Russian relations at a time when the two governments were in the midst of a rapprochement. Turkish President Recep Tayyip Erdogan and his Russian counterpart, Vladimir Putin, were at loggerheads over the conflict in Syria. The Russian intervention into the war last year on behalf of a Syrian regime opposed by Ankara infuriated the Turks. It led to the downing of a Russian fighter jet by Turkish authorities and accusations from the Kremlin that Turkey was in league with Islamist extremists.

More recently, though, Ankara and Moscow moved toward rapprochement and a mending of fences, rooted in part by a jointly-shared frustrations with Europe and the United States. Before the Syria crisis, the two countries shared reasonably close ties, anchored in energy interests. Erdogan's political style, meanwhile, has a great deal in common with that of Putin. Russia and Turkey worked together in recent weeks to enable the evacuation of refugees from the stricken city of Aleppo, even while they backed opposing factions in the battle.

But there is a long, profound history of unease between Russian and Turkish rulers. During the Cold War, Turkey was a heavily armed NATO bulwark in the shadow of the Soviet empire. And well before the advent of the U.S.S.R. and the modern Turkish republic, the jockeying between Russians and Turks had a huge effect on the political fate of a vast sweep of Europe and the Middle East.

Wars, deportations, and the specter of genocide

In the 18th and 19th centuries, the expansionist Russian empire and the Ottomans fought myriad wars. They largely resulted in Ottoman setbacks, with the Russians wresting control of the northern rim of the Black Sea and chipping away at Ottoman domains in Eastern Europe and the Balkans. The Crimean War, a brutal conflict in the 1850s, brought in an alliance of European powers in defense of the Ottomans and saw the continent's first chilling encounter with the horrors of large-scale trench warfare.

The rulers of both empires saw themselves as standard bearers of civilizations — the Ottomans as the seat of Islam, the Russians as the champions of the Orthodox Church and the redeemers, even, of the legacy of the ancient Byzantines. The czars in Moscow coveted Istanbul and saw in its conquest a pathway to the warm waters of the Mediterranean and suzerainty over the Holy Lands.

That never came to pass, but a lot else did. Russian campaigns in the Caucasus and lands around the Black Sea saw the massacre and mass deportations of populations of Turkic Muslims. In 1864, for example, Russian forces carried out what some have deemed "the first modern genocide on European soil," after they seized the lands of the Circassians — which include the area around Sochi, where Russia staged last year's Winter Olympics.

Tens of thousands of Circassians were systematically butchered; countless others died of starvation or cold as they trekked into exile. Some accounts suggest that as many as a million — half of the ethnic group's total population — died at the time. Now, up to 5 million Turks claim some form of Circassian or other Caucasian heritage.

It worked in the other direction, as well. Most infamously, as World War I raged, the Ottomans carried out mass deportations and killings of the empire's Armenians, the vast majority of whom lived in what is now central and eastern Turkey. Fearing this community of Christians to be a potential Russian fifth column, Ottoman leaders gave orders for their removal from their homelands.

WorldViews documented the scale of the tragedy that took place beginning in 1915, with countless Armenians executed, raped and forced into grim death marches into the desert. Scholars, international organizations and a host of Western governments believe the atrocities amount to genocide. An estimated 5 million Ottoman civilians perished between 1914 and 1922, casualties of the upheavals that surrounded the empire's implosion.

Hundreds of thousands of Armenians eventually escaped to Russian lands, some settling in what is now modern-day Armenia — once a part of the Ottoman Empire that, until the 19th century, was largely Muslim.

The birth of nations

In the 19th century, Russia played a prominent role in fomenting nationalism in parts of Eastern Europe and the Balkans once lorded over by the Muslim Ottomans. Russia had a hand in a number of prominent 19th-century liberation movements — from Greece to Serbia to Bulgaria. That was a role that led it into a geopolitical competition with the Austro-Hungarian empire, tensions that would eventually flare into World War I.

The wars that flared in the late 19th century, including the seismic Russo-Turkish war of 1877-1878 and the later Balkan wars that preceded World War I, made clearer the borders of Eastern Europe's future nation-states. It also led to massive population displacements; the exodus of Christian, Jewish, and Muslim refugees in various directions; and the collapse of the fragile cosmopolitanism that once characterized parts of the Ottoman Empire, especially its port cities.

The map of the Middle East

The political map of the modern Middle East is considered to be the product of French and British scheming in the aftermath of World War I and the collapse of the Ottoman Empire. But Russia played its part, as well, assenting to the 1916 Sykes-Picot agreement, upon whose lines the boundaries of the region are partially (but not entirely) drawn.

The Bolshevik revolution voided some of the commitments made to Moscow — which included control over Istanbul as well as a mandate for eastern Anatolia. But British and French strategists at the time were fully aware of the shadow of Russia and arrayed their spheres of influence accordingly.

The Arab states that eventually emerged have all grappled with their own dysfunctions — challenges of governance, identity and ethnicity that still carry the seeds of far older conflicts.

This post was originally published on Oct. 9, 2015, but has been updated to reflect more recent events.

More on WorldViews