A man who shared photos of himself holding a shotgun alongside anti-Muslim messages has been jailed for four years.
Jay Davison, 38, of Craig Yr Allt in Rhiwbina, Cardiff, posted the "extremely offensive" messages in August 2018, Cardiff Crown Court heard.
He urged people to "stand up" in the posts on Instagram and Whatsapp.
A jury found him guilty of stirring up religious hatred and two counts of stirring up racial hatred.
He was cleared of two further counts of stirring up religious hatred in a trial last month.
Jennifer Josephs, prosecuting, said: "These posts were extremely offensive.
"The images showed him bare chested holding a shotgun. He then left comments below those images.
"He was using language that you normally associate with white supremacists."
During his trial, Davison denied the charges and said the photos were taken at a friend's house after an evening of drinking, that he had no racist views and did not intend to incite racial hatred.
"It was terrible judgement on my behalf and I should not have posted it," he said.
"It was drunken stupidity. When I am sober I am a completely different person."
Hashim Salman, defending, said: "Although not immediately removed, the time it took for Davison himself to reach for the sense and for those senses to prevail and remove the material was short.
"Though not the strongest mitigation, his account was locked and private.
"He is disgusted and embarrassed with himself."
Sentencing Davison, Judge Tracey-Lloyd Clarke said: "The manner and way you behaved reveals something of your inner thoughts and for you then to take a photo of yourself holding a firearm makes this a matter so serious only an immediate custodial sentence is appropriate."
Jenny Hopkins, from the Crown Prosecution Service, added: "This is a warning to people that posting material online can have damaging consequences for them offline."