Men believed to be members of the banned Revolutionary People's Liberation Party-Front (DHKP-C) posted pictures on social media of a gun being held to Mehmet Selim Kiraz's head, threatening to shoot him unless authorities meet their demands.
The group's flag could be seen in the background as Mr Kiraz was held gagged and with his hands tied in front of him.
According to a statement released on halkinsesi.tv, the militants gave authorities until 3.36 pm local time (1.36pm BST) to meet their demands - three hours after they stormed the court building.
Speaking to the Hürriyet Daily News, Deputy Chief Prosecutor Vedat Yiğit said negotiations between militants and police "continue via a mediator that they picked".
"Our negotiators and Umit Kocasakal, the head of the Istanbul Bar Association, are talking to the militants," Istanbul Police Chief Selami Altunok said.
"We are trying to resolve the issue without anyone being hurt."
Special forces outside the İstanbul courthouse where prosecutor is held hostage by armed men. Photo via AP pic.twitter.com/8Dzo5bsRwd
— Abdullah Ayasun (@abyasun) March 31, 2015
Witnesses said shots were heard at the court house when Mr Kiraz was seized and special forces have since entered the building, which was evacuated and cordoned off.
"We were on the sixth floor. A black-haired man wearing a suit entered the prosecutor's room and fired a gun three times," Mehmet Hasan Kaplan, who works in the building, told Reuters, adding that the attackers also claimed to have explosives.
Live coverage of the hostage crisis stopped on Turkish television on Tuesday afternoon when a ban was imposed by the government. It was reportedly one of more than 150 such gagging orders issued in the last four years.
Special police forces entered İstanbul courthouse for a possible operation to rescue prosecutor held hostage byDHKP/C pic.twitter.com/ZWFQEX2Cpr
— Abdullah Ayasun (@abyasun) March 31, 2015
Mr Kiraz is investigating the death of 15-year-old Berkin Elvan, who was hit by a police gas canister fired during nationwide anti-government protests in 2013.
Tens of thousands of people took to the streets following his injury and subsequent death after 269 days in a coma.
Berkin's death - the eighth related to protests in Gezi Park - re-ignited anger at the government, becoming a further symbol of police and government impunity.
Militants' conditions for the prosecutor's release include a television confession by the police officers suspected of killing Elvan, the prosecution of the officers responsible in a "people's court" and the acquittal of all people being tried for participation in solidarity rallies after his death, the Hurriyet Daily News reported.
Hüseyin Aygün, a Turkish lawyer and member of parliament with the Republican People's Party, wrote on Twitter that people want "justice, not revenge" for Berkin's death.
He spoke to the boy's father, Sami, after the crisis broke out and quoted him as saying: "My son is dead, but someone else should not die. The prosecutor must be released. Blood cannot be washed with blood."
"I don't want anyone to even get a nosebleed. Until today, I've only demanded justice, and I only want a fair trial," Mr Elvan wrote later on Twitter.
The DHKP-C has been listed as a terrorist organisation by Turkey, the European Union and US after a string of assassinations and suicide bombings since its foundation in the 1970s.
It was unclear how militants entered the Çağlayan Justice Palace, thought to be the largest courthouse in Europe, but Istanbul was one of dozens of Turkish cities and provinces hit by a massive power cut today believed to be the country's worst blackout in years.
In January, the DHKP-C claimed responsibility for a suicide bombing at a police station in Istanbul's historic Sultanahmet district that killed one officer and wounded another, claiming it was to "settle scores" over Berkin's death.
Marxist-Leninist militants said on their website the ruling AK Party was responsible for the explosion and a grenade attack they launched on police at a historic palace near the Prime Minister's office in Istanbul the week before.
The DHKP-C was also behind the bombing of the US embassy in Ankara in 2013.
Prime Minister Ahmet Davutoglu has met with ministers at the AK Party headquarters to discuss the latest crisis, his office said.
Ergenekon (a turkish legend) was the name of an imaginary network that the real gladio used in prosecuting and jailing thousands of innocents including top Turkish Army generals, journalists, etc. etc. So these terrorists are not tied to Ergenekon but just terrorists working for whom I do not know. And Today's Zaman is not reliable news source anyway. Gülen and his network, a true gladio network working for cia and mossad have done great harm in this fake Ergenekon conspiracy. All those who were in jails have been released and trials to absolve them are ongoing.
Meanwhile prosecutor Kiraz is in hospital undergoing operation. The two terrorists are dead.