A Spanish court has banned a YouTuber from using the video sharing platform for the next five years after he played a prank by feeding toothpaste-laced cookies to a homeless person.

A 2017 online video showed Khangua Ren, who goes by the nickname ReSet on social media, replacing the cream in between chocolate cookies with toothpaste and giving them to a homeless person in Barcelona.

In the video, Ren then addresses the audience saying that his prank would help the victim keep cleaner teeth.

A provincial court sentenced Ren last week to pay his victim 20,000 euros ($22,500) and to a 15-month prison sentence that he won't serve unless he breaks the law again. The verdict can be appealed.

The video caused a stir and widespread condemnation in Spain.