A ban imposed on social media platforms in Turkey has been lifted as they complied with a court order to stop sharing images of a prosecutor being held at gunpoint.

While the ban on Facebook and Twitter has been lifted, talks with YouTube are continuing, reported the BBC.

The video-sharing website published the text of the court ruling, saying an "administration measure" had been enacted by Turkey's telecoms authority. It said that it was looking for ways to restore access.

Prosecutor Mehmet Selim Kiraz was taken hostage by two gunmen, belonging to a far-left group, at an Istanbul courthouse last week for leading an investigation into the death of a boy during anti-government protests in 2013. All the three died during a police rescue bid.

Officials termed the image "anti-government propaganda." Before blocking websites from sharing the pictures, the authorities had moved to stop newspapers from printing them.

A senior Turkish official said that the wife and children of prosecutor Kiraz were "upset" as the images were everywhere.

The court order blocked at least 166 websites from sharing the images.

This is not the first time that Turkish authorities have imposed bans on social media platforms.