A Barcelona-based YouTuber faces up to two years in prison over a video in which he fed Oreos filled with toothpaste to a homeless man and joked that it would help him with a long-overdue clean.

Kanghua Ren - known as ReSet to his more than a million subscribers - filmed himself filling the biscuits with toothpaste and replacing them in their packaging before feeding five of them to the homeless man in January last year.

As the 52-year-old man - named by authorities as Gheorge L. - ate the cookies, ReSet jibed: “Maybe I’ve gone a bit far, but look at the positive side: this will help him clean his teeth. I think he hasn’t cleaned them since he became poor."

ReSet, a 20-year-old originally from China, earned more than €2000 from YouTube for advertising linked to the video, which was viewed thousands of times, according to court documents reported by the Spanish daily El Pais.

He now faces a charge of a crime against moral integrity, with Spanish prosecutors seeking a sentence of two years in prison and an order to pay €30,000 in compensation to the homeless man.

Gheorge L., originally from Romania, said he was ill after eating the toothpaste-filled biscuits. “I got sick after five minutes and threw up,” he related, explaining that he had not known who ReSet was and came to fear for his life.