The assassination of Russia's ambassador to Turkey fits into a long tradition of political violence in a country where the fallout from the Syrian war is deepening the chaos.
Turkey's toxic combination of problems includes a Kurdish insurgency at home and state purges following a failed coup attempt in July, meaning the security situation will remain extremely tenuous for a while.
While Russia and Turkey suspect the killer of Ambassador Andrei Karlov was part of a wider conspiracy, the Turkish government has come under scrutiny for its tolerance — or sponsorship — of Islamist rebel groups in Syria in recent years that may have indirectly radicalized some young Turks.
"You have a blowback effect," said Halil Karaveli, a Sweden-based senior fellow at the Central Asia-Caucasus Institute and the Silk Road Studies Program.
He said a mix of hardline Turkish nationalism and Sunni Muslim fundamentalism had been prospering in some quarters in Turkey, creating the potential for homegrown violence.
Whatever motivated gunman Mevlut Mert Altintas, an off-duty policeman killed by police after shooting Karlov at a photo exhibition in Ankara on Monday, has not been confirmed. He shouted religious phrases and appeared to condemn Russian bombardments of rebel-held neighborhoods of Syria's Aleppo city — the shooting followed protests by Turks who criticized Russia's support for Syrian President Bashar Assad.
Turkish President Recep Tayyip Erdogan has blamed the movement of U.S.-based Muslim cleric Fethullah Gulen for the assassination, while Russia has said conclusions should be left to the investigators.
Gulen is already blamed for the failed military uprising in July that led to the imposition of a state of emergency, an extension in pre-trial detention, the arrest of around 38,000 people and the purging of more than 100,000 from government jobs.
Turkey and Russia, which have endured difficult relations over the past year or so, described the killing as an attempt to disrupt an improving alliance that they hope will stabilize Syria and consolidate their influence there.
The political calculations on Syria come as Turkey has endured regular bombings and other attacks, shaking the government of Erdogan even as he seeks to increase the power of his post by pushing for constitutional changes.
Accused of authoritarian behavior, Erdogan triumphantly rallied supporters after the coup attempt, but the Russian ambassador's assassination embarrassed a nation gripped by some of its worst violence in decades.
The turbulence has prompted comparisons with 1970s political unrest in Turkey that led to a 1980 military coup. Then, the deadly upheaval pitted Turkish left- and right-wing groups against each other, and the military eventually intervened in the name of restoring order, a move tainted by human rights abuses by the state.
This time around, Turkey is grappling with Kurdish militant attacks, deploying troops in northern Syria to fight Kurds and the Islamic State group, and purging suspected followers of Gulen. Turkey has also been targeted by suspected IS extremists after it gave more robust support to the U.S.-led war against the group.
Turkey's tradition of political violence includes the last stages of the Ottoman Empire in the early 20th century, according to Howard Eissenstat, an associate professor of Middle East history at St. Lawrence University in Canton, New York.
"The breakdown of the (Kurdish) peace process, Erdogan's growing authoritarianism, and spillover from the Syrian civil war have all fed into this, as has the attempted coup and the government's attempt at popular mobilization," Eissenstat wrote in an email.
If Turkey's past assassinations or assassination attempts are anything to go by, questions will swirl around the fatal shooting of Karlov even if an investigation comes to a clear conclusion:
— Mehmet Ali Agca, the Turkish gunman who shot and wounded John Paul II in 1981, first said he acted alone. Later he suggested Bulgaria and the Soviet secret services masterminded the attack, and he also implicated Iran. Released in 2010, Agca once had links to a right-wing militant group in Turkey.
— In 2007, ethnic Armenian journalist Hrant Dink, who received death threats because of comments about the mass killings of Armenians by Turks in 1915, was shot dead outside his office in Istanbul. Two suspects, including the teenage shooter, were arrested and imprisoned, but allegations that there was a cover-up by security officials who ignored warnings that Dink would be targeted have dragged on in the courts for years.
— Last year, Tahir Elci, a Kurdish lawyer who headed the Diyarbakir Bar Association in southeast Turkey, was fatally shot while making a media announcement in front of a mosque. His killing has not been solved.
Karlov's death is the latest shocking act of violence in Turkey, home to several million Syrian refugees and multiple security threats.
"In a country that is destabilized in this way, and which is involved in a war on the other side of its border, the likelihood that things are going to get worse is quite significant," Karaveli said.