A Syrian refugee who took a selfie with Angela Merkel has failed in his attempt to sue Facebook over a series of posts falsely linking him to terrorist attacks.

The photograph which Anas Modamani, from Darayya near Damascus, took of himself and the German chancellor at a Berlin refugee shelter in September 2015 has since been repeatedly shared on doctored photomontages supposedly identifying him as the culprit behind crimes and terrorist attacks across Europe.

In January, Modamani’s lawyer filed a preliminary injunction against Facebook Europe, “seeking to prevent Facebook from publishing the slanderous image of the Syrian refugee Anas Modamani in the context of terrorist attacks”.

But a court in the southern city of Würzburg on Tuesday rejected Modamani’s injunction, with the chief judge arguing that Facebook was not obliged to proactively seek out and delete defamatory posts since the social media giant was “neither a perpetrator or participant in the smears”.

Modamani’s lawyer, Chan-jo Jun, had hoped the case would result in social media platforms being forced to delete slanderous posts not just after they had been flagged up by users, but to actively seek out and stop the proliferation of illegal content. Facebook’s legal team has argued that there is no “miracle software” that automatically blocks previously deleted content from being uploaded again.

After Tuesday’s ruling, a spokesperson for Facebook told The Guardian: “We appreciate that this is a very difficult situation for Mr Modamani. That is why we quickly disabled access to content that has been accurately reported to us by Mr Modamani’s legal representatives, and will continue to respond quickly to valid reports of the content at issue from Mr Modamani’s legal representatives.”

However, The Guardian has seen examples of postings which Modamani’s lawyer claims to have flagged up to Facebook but which remain online even after the ruling. One such post, which links Modamani to an arson attack on a homeless person in Berlin, was posted on 27 December 2016 with the comment “Look: there’s Merkel’s golden boy” and has been shared over 900 times.

Jun said he was disappointed with the court’s reasoning. “The judge rejected an injunction partially on the basis that the content had already been distributed worldwide by the time of the hearing. This is a cynical argument: it means that the only way an individual could stop a slanderous story from going viral is by calling a court within two or three hours of the content being uploaded”.

Jun, who received death threats over the course of the trial, said he would not personally take the case further and the pressure was now on lawmakers to penalise social networks with financial fines when they broke the law.

Earlier this year Modamani told Der Spiegel: “I love Facebook, because I have found a home over the network. But I also hate Facebook because this Photoshop business won’t stop.”