BARCELONA, Spain (CBS Local) — A man known as YouTube prankster ReSet was sentenced to 15 months in prison last week for a prank he played on a homeless man.

Kanghua Ren drew widespread criticism in early 2017 when he posted a video of himself offering 20 euros and Oreo cookies filled with toothpaste to a homeless man in Barcelona.

In the since-deleted video, Ren acknowledged that he may have gone too far, but added, “look on the positive side: this will help you clean your teeth, I think you have not cleaned them since you became poor.”

Ren, 21, said he made the video “to effectively capture the morbid attention of his followers” after one of his 1.2 million users challenged him to fill Oreo cookies with toothpaste, The New York Times reported.

After the video went viral and created a backlash, Ren posted another video after he gave the man another 20 euros. He also tried to convince the victim’s daughter not to file a lawsuit by offering her 300 euros, according to police.

Prosecutors call the prank humiliating and caused “physical suffering,” such as vomiting and digestive discomfort.

Ren was found guilty Friday of violating the moral integrity of the homeless man and was sentenced to 15 months in prison. However, he is not likely to serve any time behind bars, as Spanish law normally allows sentences under two years for first-time nonviolent offenders to be suspended.

Even so, Ren was banned from using YouTube and other social media sites for the next five years. He was also ordered to pay the victim 20,000 euros for “moral damages,” Spanish media outlet El País reported.