The ruling followed a 2017 case when a Turkish man was convicted of posting two caricatures of President Erdogan on Facebook.
A Turkish law banning insults against President Recep Tayyip Erdoğan has been condemned by the European Court of Human Rights (ECHR).
The court said the law against attacks on the "image" of the head of state was "not in keeping with the spirit of the European Convention".
The ruling followed a case against a young Turkish man who was convicted of posting two caricatures of Erdogan on Facebook.
The man -- who is now in his 30s -- had shared an image in 2014 of the Turkish President dressed as a woman kissing Barack Obama, then president of the United States.
He was found guilty in 2017 and handed a suspended prison sentence of 11 months and 20 days. He was also remanded in custody for more than two months.
The Strasbourg court said that the punishment was "disproportionate" and that there was "no justification" for the man being held in police custody.
"Such a sanction, by its very nature, inevitably had a chilling effect on the willingness of the person concerned to express his views on matters of public interest," the court said in a statement.
Ankara has been ordered to pay the applicant €7,500 for moral damages.
Judges added that the Turkish law prohibiting anyone from "insulting the image" of the President violated human rights provisions on freedom of expression.
"Affording increased protection to the head of state by means of a special law on insult is incompatible with the Convention," the court said.