Turkey threatened to ban Google unless it removed links to images of a prosecutor being held at gunpoint.
The images were taken last week in a siege at an Istanbul courthouse when two gunmen took the prosecutor hostage. All three died during a rescue attempt.
The threatened ban on Google was lifted after the search giant removed links to sites hosting the pictures.
Turkish authorities briefly cut off several social networks in a bid to stop images circulating.
On 6 April, a Turkish court ordered the country’s net providers to cut off access to YouTube, Twitter, Facebook and more than 160 other sites that were letting people share the controversial images. They showed prosecutor Mehmet Selim Kiraz with a gun held to his head by a masked attacker.
Mr Kiraz was apparently taken hostage because he headed an investigation into the 2013 death of a boy during anti-government protests.
The two gunmen who took Mr Kiraz hostage are thought to be members of the far-left DHKP-C party. Mr Kiraz and the gunmen died in a shoot-out with police during an attempt to end the siege.
By late Monday, access to the three big social media sites had been restored after they sought out and removed copies of the image circulating on the network.
Subsequently it emerged that the court had issued a second order that threatened Google with a ban unless it removed links in its search index that led to the controversial images.
Google has yet to comment officially about the threatened ban or the action it took to avoid access being cut off.
Prior to the legal action, the images were circulating widely online and some newspapers printed them alongside articles about the siege. The publicity drew criticism from the Turkish government which said printing and sharing them was tantamount to “propaganda for the armed terrorist organisation”.
The DHKP-C is considered a terrorist group by Turkey, the European Union and the US.
The bans on social networks and threat against Google are just the latest in a series of measures taken by Turkish officials to curb what it sees as subversive use of online media.
Many protests have been organised via social media and, prior to local elections in March 2014, blocks were imposed after audio recordings were widely shared that allegedly revealed corruption among senior officials.
Figures gathered by Twitter revealed that Turkey filed more requests to remove content from the messaging service that any other nation between July and December 2014.