A man who appeared in a viral video engaging in unsanitary behavior at a Yoshinoya beef bowl diner in Osaka was given a prison term of two years and four months, and fined ¥200,000 ($1,300) on Thursday, with the sentence also reflecting a drug offense.

Ryu Shimazu, a 35-year-old construction worker, was found guilty of obstructing business operations and causing property damage by bringing a communal container of pickled ginger directly to his mouth and eating from it in a video that was shared widely online.

The sentence by the Osaka District Court also reflected a separate conviction for growing cannabis.

Prosecutors had sought a prison term of 3½ years and a fine of ¥200,000 for Shimazu for the offenses.

Presiding Judge Satona Takahashi called Shimazu's acts in the prank in September 2022 "selfish and malicious," saying he did not consider how they would affect Yoshinoya's business.

Although Shimazu admitted to the charges and showed remorse, the judge deemed he lacked morals and bears "heavy" criminal responsibility.

According to the ruling, Shimazu's behavior meant the company had to dispose of the ginger.

A male acquaintance of Shimazu who recorded the prank and shared the video on social media was fined ¥300,000 in a separate summary judgement.

The case occurred as major food chains struggled to combat viral videos of pranks showcasing unsanitary conduct, which have sparked widespread concern over the safety of eating out.