Both YouTube and popular micro-blogging site Twitter were inaccessible from Turkey for hours on Monday, with the ban on Twitter lifted late in the evening.
As of 0600 GMT, YouTube was also accessible.
The prosecutor seen in the pictures, Mehmet Selim Kiraz, was later killed in a shoot-out between his hostage takers and police last week.
A spokesman for President Tayyip Erdogan said on Monday that a prosecutor had demanded the bans because some media organisations had acted "as if they were spreading terrorist propaganda" in sharing the images of the hostage-taking.
Facebook said it had restricted access to some content as instructed and a company spokesman said it would appeal the order.
© Thomson Reuters 2015
Get your daily dose of tech news, reviews, and insights, in under 80 characters on Gadgets 360 Turbo. Connect with fellow tech lovers on our Forum. Follow us on X, Facebook, WhatsApp, Threads and Google News for instant updates. Catch all the action on our YouTube channel.