A court in Algeria sentenced a man to two years in prison for dangling a baby out the window of a high-rise building in order to get "likes" on Facebook, BBC reported on Tuesday. 

Following his arrest on Sunday, police said he was charged with "endangering the baby's safety."

The defendant had reportedly shared the photo on the social media platform last week, captioning it “1000 likes or I will drop him.

The photo then went viral, prompting thousands to demand his arrest for child abuse. 

Speaking to Algerian TV to defend himself

Speaking to Algeria's privately owned Ennahar TV, 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." 

"The picture was taken in a balcony with protective barriers. These were removed," he argued.

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

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

People were outraged

Following the man's sentencing, thousands took to social media, sharing their thoughts on both the incident and the ruling. 

Many expressed outrage at the man's "reckless behavior," and hailed the judge for her decision. 

Others felt a two-year jail sentence wasn't an appropriate punishment. 

Even after the sentence, people were still angered by the man's actions

"How could he do this to a child?! It's outrageous that he thinks Facebook likes are more important than this child's safety, what if he had fallen?" 

"This man is inhumane"

"This is just too much, I can't even comment"

Many hailed the judge for her decision

"A fair ruling that'll prevent others from recklessly putting people's lives in danger." 

Others felt the man deserved a longer sentence

"He deserves more than a two-year jail sentence."  

While a few felt the sentence is too severe

"In two years time, he's going to leave prison feeling vengeful. They should have given him community service instead of sending him to prison. It would have helped him become a better person." 

"He deserves a warning, not a two year jail sentence"