By Tuvan Gumrukcu and Umit Bektas
ANKARA (Reuters) - The Russian ambassador to Turkey was shot in the back and killed as he gave a speech at an Ankara art gallery on Monday by an off-duty police officer who shouted "Don't forget Aleppo" and "Allahu Akbar" as he opened fire.
The Russian foreign ministry confirmed the death of envoy Andrei Karlov, calling it a "terrorist act". Relations between Moscow and Ankara have long been strained over the conflict in Syria, with the two support opposing sides in the war.
Russia is an ally of Syrian President Bashar al-Assad and its air strikes helped Syrian forces end rebel resistance last week in the northern city of Aleppo. Turkey, which seeks Assad's ouster, has been repairing ties with Moscow after shooting down a Russian warplane over Syria last year.
The Ankara mayor said on Twitter the gunman as a 22-year-old police officer. Two security sources told Reuters he was not on duty at the time.
The attacker was smartly dressed in black suit and tie and stood, alone, behind the ambassador as he made a speech at the art exhibition, a person at the scene told Reuters.
"He took out his gun and shot the ambassador from behind. We saw him lying on the floor and then we ran out," said the witness, who asked not to be identified. People took refuge in adjoining rooms as the shooting continued.
A video showed the attacker shouting: "Don't forget Aleppo, don't forget Syria!" and "Allahu Akbar (God is Greatest) as screams rang out. He paced about and shouted as he held the gun in one hand and waved the other in the air.
A Reuters cameraman at the scene said gunfire rang out for some time after the attack. Turkey's Anadolu news agency said the gunman had been "neutralized", apparently killed.
Another photograph showed four people the ambassador lying on the floor.
"We regard this as a terrorist act," said Russian Foreign Ministry spokeswoman Maria Zakharova. "Terrorism will not win and we will fight against it decisively."
It was not clear whether the gunman was a lone operator, driven perhaps by popular discontent over Russian action in Syria or affiliated to a group like Islamic State, which has carried out a string of bomb attacks in Turkey in the last year.
Since a failed coup in July, President Tayyip Erdogan has been purging the police of supporters of an exiled cleric and former ally, Fethullah Gulen, whom he characterizes as the chief terrorist threat to Turkey.
U.S. STATE DEPARTMENT
Erdogan contacted Russian President Vladimir Putin to brief him on the shooting, a Turkish official said. It was not immediately clear if Erdogan would release a statement later.
Turkish Foreign Minister Mevlut Cavusoglu was due to meet with his Russian and Iranian counterparts in Russia on Tuesday to discuss the situation in Syria. Officials said the meeting would still go on, despite the attack.
Turkey's foreign ministry said it would not allow the attack to cast a shadow over Ankara's relations with Moscow.
"The attack comes at a bad time: Moscow and Ankara have only recently restored diplomatic ties after Turkey downed a Russian aircraft in November 2015," the Stratfor think-tank said.
"Though the attack will strain relations between the two countries, it is not likely to rupture them altogether."
The U.S. State Department, involved in diplomatic contacts with Russia in an attempt to resolve a refugee crisis unfolding around the city of Aleppo, condemned the attack.
Tensions have escalated in recent weeks as Russian-backed Syrian forces have fought for control of the eastern part of Aleppo, triggering a stream of refugees.
Turkey has been hit by multiple bomb attacks that have been claimed by Kurdish militants, and beat back an attempted coup in July, where rogue soldiers commandeered tanks, warplanes and helicopters in attempt to overthrow the parliament.
Since then, the government has launched a sweeping crackdown on the judiciary, police and civil service in attempt to root out the coup plotters. The involvement of a police officer in Monday's attack could raise questions for Ereogan about a force denuded now of a number of senior and rank-and-file officers.
(Additional reporting by Orhan Coskun, Nevzat Devranoglu, Tulay Karadeniz, Ercan Gurses and Gulsen Solaker in Ankara; Humeyra Pamuk and Ece Toksabay in Istanbul; Andrew Osborn and Andrey Ostroukh in Moscow; Writing by Daren Butler and David Dolan; editing by Ralph Boulton and Mark Trevelyan)