A man who filmed a pet dog giving Nazi salutes before putting the footage on YouTube has been fined £800.
Mark Meechan, 30, recorded his girlfriend's pug, Buddha, responding to statements such as "Sieg Heil" by raising its paw.
The clip was viewed more than three million times on YouTube.
Meechan, of Coatbridge, North Lanarkshire, was sentenced at Airdrie Sheriff Court after being found guilty of committing a hate crime last month.
He had denied any wrong-doing and insisted he made the video, which was posted in April 2016, to annoy his girlfriend.
But Sheriff Derek O'Carroll found him guilty of a charge under the Communications Act that he posted a video on social media and YouTube which was grossly offensive because it was "anti-Semitic and racist in nature" and was aggravated by religious prejudice.
Fining Meechan £800, the sheriff told him: "The centrepiece of your video consists of you repeating the phrase 'Gas the Jews' over and over again as a command to a dog which then reacts.
"You use the command Sieg Heil, having trained the dog to raise its paw in response and the video shows a clip of a Nuremberg rally and a flashing image of Hitler with strident music. You say the video was only intended as a joke to upset your girlfriend, whose dog you used, and nothing more.
"On the whole evidence..I found it proved that the video you posted, using a public communications network, was grossly offensive and contained menacing, anti-Semitic and racist material."
He added: "The fact that you claim in the video, and elsewhere, that the video was intended only to annoy your girlfriend and as a joke and that you did not intend to be racist is of little assistance to you.
"A joke can be grossly offensive. A racist joke or a grossly offensive video does not lose its racist or grossly offensive quality merely because the maker asserts he only wanted to get a laugh."
Meechan was supported in court by by Tommy Robinson, former leader of far-right group the English Defence League (EDL).
Speaking after being fined, Meechan said he would be appealing the sentence.
He defended the video, saying the whole point of the "joke" was "the juxtaposition of having an adorable animal reacting to something vulgar".
Meechan said: "This is a really dangerous precedent to set – for people to say things and their context to be completely ignored and then they can be convicted for it.
"You don't get to decide the context, other people don't get to decide the context, the court decides. That's dangerous."
There was a demonstration outside court by protesters claiming the case went against the principle of freedom of speech.
Comedian Ricky Gervais had taken to Twitter to comment on the case after guilty the verdict.
He tweeted: "A man has been convicted in a UK court of making a joke that was deemed 'grossly offensive'.
"If you don't believe in a person's right to say things that you might find 'grossly offensive', then you don't believe in Freedom of Speech."