A man was sentenced to two years’ jail by an Algerian court on Monday for dangling a child from the 15th floor to get Facebook ‘likes’.

The unnamed man posted a photo of himself holding the child out of a window from a high-rise building with the caption: “1,000 likes or I drop him”, the BBC reported.

He was arrested on Sunday and charged with endangering the baby’s safety, police said.

The man, a relative of the child, claimed that he was on a balcony with protective barriers, but these were removed by social media users who altered the photo.

The child’s father also asked the court to forgive the man as he was just playing a game.

But the judge said it was clear the child’s life was in danger and found him guilty.

The incident got thousands of mostly angry reactions from netizens, the BBC reported.

Algerians praised the authorities for arresting him and sentencing him.

The Straits Times/Asia News Network