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
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.