Istanbul gunmen AKP
Turkish police responding to a gunmen situation in Istanbul Reuters

Turkish security forces have arrested a gunman who stormed an office of Turkey's ruling Justice and Development Party (AKP) in Istanbul.

Special Forces intervened shortly after the armed man wearing a military-style jacket entered the seven storey-building in the Kartal district.

Footage from the scene showed the intruder emerging from a broken window on the top floor, as a large number of police cars were deployed in the street outside. The man could be seen addressing onlookers after flying a Turkish flag with a sword on it.

He had previously demanded that all those inside the building should leave, local media reported.

It was not immediately clear whether a second gunman was involved, as suggested by earlier reports.

The incident comes a day after two leftist-gunmen were killed during a shootout with security forces after they took hostage a prosecutor for the case of Berkin Elvan, a teenager killed after being hit by a gas canister in the head during Gezi Park anti-government protests in 2013.

The prosecutor, Mehmet Selim Kiraz, was also killed.

It was not immediately clear whether the two incidents were connected.

AKP is the party of the country's conservative president Recep Tayyip Erdogan.