According to report, court in Algeria has sentenced a man to two years in prison for dangling a baby out of a window in order to attract “likes” on Facebook.

The man posted a picture of himself holding the baby out of a window in a high-rise building with the caption: “1,000 likes or I will drop him.”

It prompted other social media users to demand his arrest for child abuse. He was charged with endangering the baby’s safety following his arrest on Sunday, police said.

The child was dangled out of the 15th-floor window of an apartment block in the capital, Algiers, by the man who is a relative of the child.