An Algerian father who dangled his son from a 15th-floor window demanding "1000 Facebook Likes" or he would drop him, has been sentenced to prison.

The man posted a video to Facebook while holding his son with one hand and his phone in the other with the caption "1,000 likes or I will drop him," news website Alarabiya reports.

The young boy appeared frightened and bewildered as he looked at the ground nearly 50 metres below him.

Facebook users immediately condemned the man's behaviour and contacted authorities to intervene.

The father demanded '1000 likes' or he would drop the son, according to his Facebook post. Source: Supplied More

"What is most striking is that it appears that the father is carrying his son with his left hand while using his right hand to take the picture," one user wrote.

"This means the picture is more important than the child's life."

Prosecutors told the court the father carried out the twisted stunt for no other reason but to achieve a high amount of engagement on Facebook.

He was sentenced to two years prison on Monday after being found guilty of child abuse.

Media activist Dalila Belkheir told local news outlets the offender was "not a father but a terrorist".