A gunman opened fire with a pump-action rifle in the courtyard of Istanbul's historic Topkapi Palace on Wednesday, wounding at least two people, and was still at large in the sprawling complex, state media and broadcasters reported.

Broadcasters said the attacker had not been captured, correcting earlier information, and shooting continued at Topkapi in the city's tourist district of Sultanahmet.

State-run Anatolian news agency said a soldier and private security worker were wounded. Television pictures showed ambulances arriving outside the palace walls. The Ottoman era palace is one of Istanbul's top tourist draws.

CNN Turk showed a photograph of a man, identified as the attacker, holding a rifle and wearing an ammunition belt and a backpack, 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 (0800 GMT). A coach party was disembarking to enter the gates, which had just been opened when shooting was heard inside, Turkish television channels reported.

Three armed security force officers were shown walking on the wall at the entrance.

Police evacuated and sealed off the area, CNN Turk said.

Kurdish, Islamist and leftist militants are all active in Turkey.

(Writing by Daren Butler; Editing by Myra MacDonald)