Several other people were reportedly also injured in the attack, a day after protests in Turkey over Russia’s military intervention in Syria.
Karlov was taken to hospital to be treated for his injuries.
According to Russian TV, the ambassador had been attending an exhibition called “Russia as seen by Turks”.
Video of the event shows Mr Karlov making a speech when gunshots ring out.
The camera pulls back to show a smartly dressed gunman, wearing a suit and tie, waving a pistol and shouting.
The gunman shouts: “Don’t forget about Aleppo, don’t forget about Syria” and uses the Islamic phrase “Allahu Akbar” (God is great”).
While there were protests in recent days, on a political level the Turkish and Russian governments have been co-operating in the Aleppo ceasefire operation, the BBC’s Turkey correspondent, Mark Lowen, reports.
It is too early to know the motives of the attacker, who has not yet been named. Some reports say he entered the art gallery using a police ID card, our correspondent adds. (BBC)