The attacker was killed by police forces after he refused to obey orders and continued to shoot from Topkapi Palace, located in the city's tourist district of Sultanahmet
A soldier and private security worker were wounded in the attack, which lasted approximately an hour. A significant number of police and ambulances were seen arriving outside the palace walls. The Ottoman era palace is one of Istanbul's top tourist draws.
The man, identified as the attacker, was holding a rifle and wearing an ammunition belt and a backpack, and was photographed standing behind a low wall. He wore a cap and a dark coat.
Shooting could be heard in live television footage from outside the palace, which normally opens to tourists at 10 am. A coach party was disembarking to enter the gates, which had just been opened when shooting was heard inside, television channels reported.
Three armed security force officers were shown walking on the wall at the entrance.
Police evacuated and sealed off the area, and after extensive attempts to coax the perpetrator, which went on for approximately an hour, police rendered the gunman ineffective.