Istanbul - Twitter has complied with Turkey's request to remove photographs of an Istanbul prosecutor held at gunpoint by far-left militants, an official said, and a ban on the micro-blogging site was lifted, several hours after it was imposed.
"Twitter has agreed to shut down accounts and remove images relating to last week's hostage-taking. The website will reopen to access very shortly," the senior official said before the site became accessible again.
Twitter was not immediately available for comment. The website earlier said it was working to restore service.
Turkish authorities banned access earlier on Monday to Twitter and YouTube after an Istanbul judge imposed a block on access to social media sites showing photographs of slain prosecutor Mehmet Selim Kiraz held at gunpoint by far-left militants and taken hours before he was killed in a shootout last week.
Talks with YouTube were still underway, the official said. YouTube remained blocked after the ban on Twitter was lifted.
Facebook said it had complied with a Turkish court order requiring it to restrict access to some content or face a block on its service. A company spokesperson said it would appeal the order.
Presidential spokesperson Ibrahim Kalin said a prosecutor had demanded the block because some media organisations had acted "as if they were spreading terrorist propaganda" in sharing the images of the hostage-taking.
"This has to do with the publishing of the prosecutor's picture. What happened in the aftermath is as grim as the incident itself," Kalin said.
"The demand from the prosecutor's office is that this image not be used anywhere in electronic platforms," he told a news conference in Ankara.
Prosecutor Kiraz died from his wounds last Tuesday after security forces stormed the office where members of the far-left Revolutionary People's Liberation Party-Front (DHKP-C) had taken him hostage. His two captors were also killed.
The DHKP-C had published a picture of Kiraz with a gun to his head and said it would kill him unless its demands were met.
"The wife and children of prosecutor Kiraz have been deeply upset. The images are everywhere," the Turkish official earlier said.
Google said it was working to restore service to the YouTube video-sharing site, which it owns.
Turkey's telecoms regulator could not immediately be reached and there was no statement on its website.
Turkey temporarily blocked Twitter and YouTube before local elections in March 2014, after audio recordings purportedly showing corruption in then-Prime Minister Tayyip Erdogan's inner circle were leaked on their sites. That decision caused a public uproar and drew heavy international criticism.
Turkey filed over five times more content-removal requests to Twitter than any other country in the second half of 2014, data published in February by the micro-blogging site showed.
In 2014, Turkey tightened laws allowing sites to be blocked by the authorities more easily.