1.2047176-610502838
A relative who dangled the child out of a 15th-floor window and posted the pictures on Facebook was sentenced to two years in jail on Monday. Image Credit: Screengrab\ Facebook

A man desperate for Facebook "likes" was sentenced to two years in jail for dangling a baby out of a window.

On his social media page, the man in Algeria posted a picture of himself holding the baby out of the 15th-floor window of a high-rise with the caption: "1,000 likes or I will drop him."

The pictures showed the child in a state of fear and bewilderment, prompting other social media users to alert authorities demanding for the man's arrest for child abuse.

The man was charged with endangering the baby's safety following his arrest on Sunday, Al Arabiya quoted police on Tuesday. 

The man, who is a relative of the child, denied he put his life at risk, saying the image had been altered by social media users, Algeria's privately-owned Ennahar TV reported.

The man was earlier incorrectly reported as the child's father.

Ennahar quoted the man as saying that the balcony had protective bars that were Photoshopped by Facebook users to make the image viral.

The child's father urged the court to forgive the man, saying he had just been playing a game.

However, the judge ruled against him, saying the picture was clear and the child's life was in danger.

Articles shared on social media about the incident got thousands of angry reactions, according to a BBC North Africa report. Many Algerians insulted the man, and praised authorities for arresting and sentencing the man.