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.
Samsung Galaxy Watch 9 (44mm, LTE)
Starts from ₹44,999
Samsung Galaxy Watch 9 (40mm, LTE)
Starts from ₹37,999
Samsung Galaxy Watch 9 (40mm)
Starts from ₹37,999
CMF Buds Neo True Wireless Stereo (TWS) Earphones
Starts from ₹2,199
Amazfit Cheetah 2 Ultra
Starts from ₹54,999
JBL Tune 780NC Wireless Headphones
Starts from ₹7,999
Xiaomi 18 Fold With Xring O3 Chip Allegedly Surfaces on Geekbench Ahead of Launch
Samsung Galaxy S27 Series May Get Scam Detection Alongside Galaxy S25 Series, and Older Flagships