He also threatened terrified spectators, yelling "Allahu Akbar" and saying that the murder was vengeance for Russia's actions in Aleppo.
Istanbul: The assassin of the Russian ambassador to Ankara was a 22-year-old from a quiet region in the west of Turkey who had served with the anti-riot police for less than three years.
The man identified as Mevlut Mert Altintas shouted "Allahu Akbar" (God is greatest) and "Don't forget Aleppo" as he waved his gun around at a cultural centre in the Turkish capital.
But there has yet to be any indication Altintas, who was later "neutralised" by police", was attracted to religious extremism or had any history of activism.
Images showed the clean-shaven man smartly dressed in a suit, tie and white shirt pull out a gun and fire at ambassador Andrei Karlov from behind as the envoy opened a Russian photography exhibition in Ankara.
He then threatened terrified spectators, yelling "Allahu Akbar" and saying that the murder was vengeance for Russia's actions in the war-battered Syrian city of Aleppo.
Interior Minister Suleyman Soylu said Altintas was born in the town of Soke in Aydin province in western Turkey and attended a special school for training future policemen.
Altintas then joined the Ankara anti-riot police - the Cevik Kuvvet in Turkish - and had worked there for the last two-and-a-half-years.
The region of Aydin on the Aegean coast is one of Turkey's most peaceful regions well away from trouble-spots and the country's most religiously conservative areas.
After the attack on Karlov, Altintas refused to surrender and remained inside the exhibition centre as clashes took place with police for 15 minutes.
But he was then killed by police in an operation, authorities said.
Reports said that his mother, father and sister were immediately detained for questioning in their homes in western Turkey.
The mayor of Ankara, Melih Gokcek, known for his outspoken comments, speculated on his official Twitter account that the attacker may be linked to the group of Fethullah Gulen blamed for the July 15 coup aimed at toppling President Recep Tayyip Erdogan.
His suggestion has yet to be echoed by other officials.
In footage from the scene, Altintas talks about pledging allegiance to jihad in Arabic.
Switching to Turkish, he then says: "Don't forget about Syria, don't forget about Aleppo. All those who participate in this tyranny will be held accountable".
The attack came after days of angry protests in Turkey over Russia's actions in Syria in support of President Bashar al-Assad.
But Erdogan has spearheaded a rapprochement with Russia in recent months and the two countries had been working closely to remove civilians from war-torn Aleppo.