A Turkish prosecutor held hostage in an Istanbul courthouse died in hospital on Tuesday night after special forces stormed the building to rescue him following an hours-long stand-off with suspected members of a far left militant group.

Gunmen claiming to be affiliated with the Revolutionary People's Liberation Party-Front (DHKP/C), which is regarded as a terrorist group by the US, Europe, and Turkey, had for almost eight hours been holding the prosecutor Mehmet Salim Kiraz, who was investigating the killing of teenager Berkin Elvan during a 2013 protest.

Kiraz was freed after a shootout in the courthouse but later died of his injuries. Istanbul police chief Selami Altinok said that the hostage takers had been killed.

Turkish media reports gunshots from ?stanbul courthouse. Prosecutor was rescued while initial reports suggest DHKP/C militants were shot. — Abdullah Ayasun (@abyasun)March 31, 2015

Latest: 3 militants, all of them, were killed by police in shootout. A bloody end for the hostage crisis. Prosecutor wounded and in hospital — Abdullah Ayasun (@abyasun)March 31, 2015

The gunmen earlier released images on social media purporting to show the prosecutor with a gun held to his head, along with a list of demands. They issued a deadline of 3:36pm local time (8:36am ET) for those demands to be met or they would shoot the hostage, according to translations published by Turkish media.

Talks had been ongoing throughout the afternoon but following reports that they had been broken off, gunfire was heard and smoke was seen coming from the building, according to Reuters.

BREAKING: Several gunshots heard, smoke visible from building where Turkish far-left group is holding prosecutor hostage: Reuters witness — Reuters Top News (@Reuters)March 31, 2015

Ahead of the deadline, a reporting ban was imposed on the courthouse, and live television broadcasts suspended. Special forces earlier entered the building for a possible operation to rescue Kiraz while staff were evacuated.

Deadline by militants expired. Police is about to launch an operation. We are left in darkness by media ban. What is going on out there? — Abdullah Ayasun (@abyasun)March 31, 2015

Istanbul's police chief told media following the expiry of the deadline that talks were underway with the militants and that authorities hoped to resolve the situation without the loss of life or use of force. Officials continued to arrive at the courthouse through the course of the afternoon, with initial reports that negotiations were constructive, though no further details were given.

?stanbul police chief: We hold negotiations with militants holding prosecutor hostage. We hope that this will end peacefully without blood. — Abdullah Ayasun (@abyasun)March 31, 2015

Berkin Elvan died in March 2014, eight months after the then 14-year-old was hit in the head by a tear gas canister shot by police as he went out to buy bread during protests in the capital's Gezi Park. His death has prompted large scale protests, some of which have ended in clashes with security forces.

Related: Istanbul's Gentrification Wars. Watch video here.

Special police forces entered ?stanbul courthouse for a possible operation to rescue prosecutor held hostage byDHKP/C — Abdullah Ayasun (@abyasun)March 31, 2015

Al Jazeera Turkey said that a man in the crowd gathered outside the courthouse was arrested after shouting "Berkin Elvan is immortal!"

Last 30 minutes. Militants vowed to shoot the prosecutor if their demands are not met. Police emptied the entire building. — Abdullah Ayasun (@abyasun)March 31, 2015

The gunmen had demanded that the police officer who shot the teenager appear on live television and confess his guilt, and that all those involved in the death be tried in people's courts. The militants also asked for safe passage out of the courthouse and the formation of a government negotiating team involving prominent figures for talks with the Marxist group.

Abdullah Ayasun, a reporter for the daily newspaper Today's Zaman, said Berkin Elvan's father had called for the group to free their hostage. Salim Elvan was later brought to talk to the militants by phone, Ayasun reported, urging them to let the prosecutor go.

Salim Elvan earlier told Turkish media he wanted to see a fair trial. "My son is dead, I don't want any others to die. Let him go," he was quoted as saying.

Istanbul suffered a widespread electricity blackout this morning and it has been reported that the X-ray machines at the entrance of the courthouse may not have been working at the time the militants entered the building.

DHKP/C is an extreme left Marxist-Leninist party with an anti-American outlook that wishes to see the Turkish government replaced with a communist regime. Its members have carried out a series of violent attacks over more than three decades, including killings and suicide bombings, and are on the US, European Union and Turkish terrorist black lists.

The group claimed responsibility for a 2013 suicide attack on the US Embassy in Ankara that killed a guard as well as a series of rocket attacks on police building and government buildings. Turkish authorities say it has killed dozens of civilians and security officers since its formation in 1978.