Turkey Twitter block lifted after image removed Published duration 6 April 2015

image copyright Reuters image caption The siege ended with a shootout that left the attackers and their hostage dead

Social media restrictions are being lifted in Turkey, as sites comply with a court order to stop sharing images of a prosecutor being held at gunpoint.

The blocks on Facebook and Twitter were later lifted after they both complied. Talks with YouTube are continuing.

Two gunmen, reportedly from a far-left group, took the prosecutor hostage at an Istanbul courthouse last week. All three died during a police rescue bid.

Turkey has previously blocked access to social media.

Officials described the images of prosecutor Mehmet Selim Kiraz as "anti-government propaganda".

Before imposing the blocks on the websites, Turkish authorities had moved to stop newspapers printing the images.

The newspapers were accused by the government of disseminating "terrorist propaganda" for the DHKP-C group that was reportedly behind the attack on the courthouse. The DHKP-C is considered a terrorist group by Turkey, the European Union and US.

Mr Kiraz was apparently taken hostage because he headed an investigation into the 2013 death of a boy during anti-government protests.

Analysis: Selin Girit, BBC News, Istanbul

Millions of social media users tried to post comments or videos on their favourite platforms but with no success.

But the block did not stop people from tweeting. Newspapers and individuals alike shared guidelines on how to circumvent the ban.

The hashtag #TwitterisblockedinTurkey became the number one trending topic worldwide.

The Turkish government is not a fan of social media platforms. Last year, just before the local elections, access to Twitter and YouTube were also banned.

The then prime minister, now President Recep Tayyip Erdogan, said that Twitter was a menace to society.

With the general elections to come on 7 June and tensions running high, many people fear similar bans on social platforms could follow.

The pictures showing attackers holding a gun to Mr Kiraz's head were being widely shared on social media, leading authorities to act, reported Turkish newspaper Hurriyet

"The wife and children of prosecutor Kiraz have been deeply upset. The images are everywhere," a senior Turkish official told the Reuters news agency.

In total, 166 websites which shared the images were blocked by the court order.

YouTube published the text of the court ruling on its website saying an "administration measure" had been enacted by Turkey's telecoms authority. It said it was seeking ways to restore access.

Facebook was also subject to the same block but it is believed the restrictions on it were lifted because it removed the images before the expiration of a deadline imposed by the court. Twitter reacted more slowly and access to the messaging system was blocked for several hours on Monday.

Many Turkish people reported via social media that they were having problems accessing the three big net sites as well as many other net services.

This is not the first time that Turkish authorities have imposed blocks on social media sites and networks.

In the run-up to local elections in March 2014 blocks were imposed after recordings circulated allegedly revealing corruption among senior officials.

Figures provided by Twitter revealed that Turkey filed more requests to remove content from the social network than any other nation between July and December 2014