The Russian ambassador to Turkey, Andrey Karlov, at the art gallery in Ankara where he was shot Monday. Burhan Ozbilici/AP Russia's ambassador to Turkey, Andrey Karlov, was assassinated Monday, shot in the back by a lone attacker while attending a private event at an Ankara art museum.

Russia's Ministry of Foreign Affairs has confirmed that Karlov died in the shooting, which was captured on video and in photos by reporters who were at the scene. Russia called the incident an act of terror.

Karlov was giving a speech at the opening of an exhibition — titled "Russia Through Turks’ Eyes" — at the Ankara Center for Contemporary Art when he was shot in the back about five times, the videos showed.

Three other bystanders were shot, according to media reports, and taken to the hospital. Their conditions are unknown.

The gunman — who was wearing a suit and had a police identification that allowed him to bypass the gallery's security — was shot dead by the Turkish police.

Turkey's interior minister identified the gunman as 22-year-old Mevlüt Mert Altıntaş, a member of the Ankara police department's riot unit who graduated from İzmir Rüştü Ünsal Police Academy in 2014.

The gunman seen in video of the shooting shouted that the attack was revenge for Aleppo.

"The assassin shouts in Arabic: We've made an oath to Muhammad to die in martyrdom ... [It is] a revenge for Syria and Aleppo," Syrian journalist and Middle East analyst Hassan Hassan said on Twitter.

The gunman then shouted in Turkish: "Don't forget Aleppo. Don't forget Syria ... You won't be safe. Only my dead body will leave here."

A man at the scene of the shooting at the art gallery in Ankara on Monday. Burhan Ozbilici/AP Pro-government Turkish journalist Abdulkadir Selvi told CNN Turk that after shooting the ambassador the gunman at one point recited a slogan used by former Al Qaeda affiliate Jabhat al-Nusra: "We obey the jihad order."

The gunman spoke Turkish with "an educated, Istanbul accent," Turkish analyst Barin Kayaoglu said. "No trace of foreign accent, Arab or otherwise."

The Kremlin has declared the assassination a terrorist attack. The mayor of Ankara, Ibrahim Melih Gokcek, tweeted that the gunman was a member of Turkey's Gulenist opposition movement and that his declarations about Aleppo were merely a distraction.

Fethullah Gulen, the leader of the Islamic movement who has lived in exile in the US since 1999, condemned the assassination in a statement released on Monday.

"I condemn in the strongest terms this heinous act of terror," Gulen wrote. "No terrorist attack can be justified...I send my deepest condolences to Ambassador Karlov's family and to the Russian people for this tragic loss."

Karlov, 62, was married with a son. He was appointed Russia's ambassador to Turkey in 2013 after serving as Russia's ambassador to North Korea.

Before Monday, a Russian ambassador was most recently killed in 1927.

'Your expectations are wasted'

Turkish-Russian relations had been precarious but improving since Turkey shot down a Russian warplane along the Turkish-Syrian border in November 2015.

People reacting after Karlov was shot. Burhan Ozbilici/AP

Turkey and Russia are on opposite sides of the war in Syria, with Turkey supporting the opposition and Russia supporting Syrian President Bashar Assad. Turkey had been holding secret peace talks over Syria between Russian and opposition officials in Ankara that resulted in a cease-fire and a deal to evacuate civilians and fighters from rebel-held eastern Aleppo.

In a statement, Turkish President Recep Tayyip Erdogan called the attack "provocation" aimed at damaging Turkey's normalization of ties with Russia. He said that Turkey and Russia will jointly investigate the assassination, reiterating that "intense cooperation with Russia" over Aleppo was "helping to save lives."

"I call out to those who are trying to break this relationship," Erdogan continued, "Your expectations are wasted."

Turkey's foreign minister, Mevlüt Çavuşoğlu, was due to visit Moscow on Tuesday for talks on Syria with his Russian and Iranian counterparts. The chairman of Russia's legislature announced that the talks in Moscow would go ahead, Reuters reported.

Russian President Vladimir Putin, meanwhile, called the assassination an attempt to "undermine" Russia-Turkey ties and derail Moscow's attempts to find, with Iran and Turkey, a solution for the Syria crisis.

Turkey's President Tayyip Erdogan (2nd R) walks with his Russian counterpart Vladimir Putin prior to their meeting at the Group of 20 (G20) leaders summit in the Mediterranean resort city of Antalya, Turkey, November 16, 2015. Kayhan Ozer/Pool/Reuters

The museum is located in the heart of Ankara's diplomatic quarter, a "one-minute walk to the U.S. Embassy & two-minute walk to the Turkish Parliament," said Aykan Erdemir, who served in Turkey's parliament.

US Secretary of State John Kerry said in a statement: "The United States condemns the assassination today in Ankara of Russian Ambassador Andrey Karlov. Our thoughts and prayers are with his loved ones, the Russian people, and with the other victims who were injured in this shooting."

He continued: "We stand ready to offer assistance to Russia and Turkey as they investigate this despicable attack, which was also an assault on the right of all diplomats to safely and securely advance and represent their nations around the world."

President-elect Donald Trump condemned the assassination in a statement released on Monday evening.

"Today we offer our condolences to the family and loved ones of Russian Ambassador to Turkey Andrei Karlov, who was assassinated by a radical Islamic terrorist," he said. "The murder of an ambassador is a violation of all rules of civilized order and must be universally condemned."