He also shouted "Allahu akbar," the Arabic phrase for "God is great" and continued in Arabic: "We are the descendants of those who supported the Prophet Muhammad, for jihad."

The gunman, who was shot dead by police, has been identified as 22-year-old Mevlüt Mert Altintas, 22, an off-duty member of the Ankara special forces police department.

Meanwhile, the US Security Department reported an "ongoing security incident" outside the US Embassy in Ankara, close to the gallery where Ambassador Karlov was assassinated.

Andrei Karlov, the Russian Ambassador to Turkey, moments before a gunman opened fire on him. Karlov was rushed to a hospital after the attack and later died from his gunshot wounds. The gunman is seen at rear on the left.AP Photo - Burhan Ozbilici

As screams rang out, he could then be seen pacing about and shouting as he held the gun in one hand and waved the other in the air.

The attacker also smashed several of the framed photos hung for the exhibition. There was panic as people ran for cover.

Three other people were wounded in the attack, Turkey's NTV television said.

The gunman was shot dead by police after he killed the ambassador. AP Photo - Burhan Ozbilici

After shooting the ambassador, the gunman climbed to the second floor of the same building and a 15-minute shootout with police ensued before he was killed, Turkey's Anadolu news agency reported.

Turkish officials said Altıntaş had used his police credentials to enter the building.

The Turkish daily newspaper, Hurriyet, said Turkish special forces had surrounded the building, Cagdas Sanatlar Merkezi, a major art exhibition hall in the Cankaya district of Ankara where most foreign embassies are located including Russia's mission.

"We are currently in contact with Turkish authorities, who are assuring us that a thorough, comprehensive investigation will be conducted," foreign ministry spokeswoman Maria Zakharova said in remarks broadcast on Russian television, according to CNN. "Murderers will be punished. Terrorism won't sustain. We'll fight it."

Minister Soylu did not give a motive for the attack.

WHO WAS AMBASSADOR KARLOV?

Karlov joined the diplomatic service in 1976. He served as Russia's ambassador to Pyongyang in 2001-2006, and later worked as the chief of the Foreign Ministry's consular department. He had served as the ambassador to Turkey since 2013.

"It's a tragic day in the history of our country and Russian diplomacy," Russian Foreign Ministry spokeswoman Maria Zakharova said in televised comments.

"Ambassador Karlov has made a lot of personal contributions to the development of ties with Turkey. He has done a lot to overcome a crisis in bilateral relations.

"He was a man who put his heart and his soul into his job. It's a terrible loss for us and also the world."