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 - who posts under the name Count Dankula - 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."
Andrew Black, BBC Scotland Reporter, at Airdrie Sheriff Court
Even before Mark Meechan arrived for his sentence, dozens of free speech campaigners were outside the building, protesting his innocence.
Also present was Tommy Robinson, ex-leader of the far-right English Defence League.
Inside, courtroom number two was packed out as members of the public and journalists sat poised to hear Sheriff Derek O'Carroll impose sentence.
Meechan's lawyer told the court his client was a man who enjoyed "shock humour" and questioned why he was in the dock, given the number of famous comedians who incorporate lines about the holocaust into their acts.
Sheriff O'Carroll told Meechan he'd made a deliberate decision to post offensive material in a place where any member of the public could see it.
At the same time, the sheriff said he was a first-offender with a low risk of committing further crime - and that he'd learned from his experience.
Afterwards Meechan emerged from court defiant - insisting all he'd done was exercise his right to free speech.
He left vowing to appeal.