Mehmet Selim Kiraz had been handling the case of Berkin Elvan, who was critically injured during 2013's Gezi Park protests and died in March 2014 after being in a coma for 269 days.
The media ban is in line with emergency security legislation, Turkey's Supreme Board of Radio and Television, RTUK, said in a statement.
The board added that the law allows the "Prime Minister or any other minister assigned by him to introduce such a ban under circumstances that national security clearly requires or poses possible threats against the public order."
Today’s incident took place at around 12.30 p.m. (Turkish local time) at Kiraz’s office on the sixth floor of the Okmeydani district courthouse.
Police moved into position and evacuated the floor where Kiraz was taken hostage. Snipers are also in position.
Two gunshots were heard as security forces were trying to gain access to the office. It is not known if there are any injuries.
It is not clear how gunmen entered the courthouse, where security measures are tight. There has been speculation that they might have entered the building using a forged attorney ID.
A photograph — showing a gunman pointing a weapon at Kiraz’s head — was published on a Facebook page claiming to be close to an armed leftist group called the Revolutionary People's Liberation Party-Front, or DHKP-C.
In the background is a poster reading in Turkish: "We want Berkin's murderers."
The Facebook page also said that DHKP-C members would kill the prosecutor if their demands were not met within three hours.
The DHKP-C is a 1978-founded Marxist-Leninist party, considered a terrorist organization by Turkey, the United States and the European Union.
In recent years, the organization has increased its attacks on police officers and foreign consulates, some of which claimed lives.