A far-right teenager who branded the Duke of Sussex a race traitor in an “abhorrent” online post has been locked up for four years and three months.

University student Michal Szewczuk created an image of Harry with a pistol to his head against a blood-spattered background.

The picture, which also featured a blood-smeared swastika, was shared on a far-right social media platform in August last year, just a few months after the duke married mixed race former actress Meghan Markle.

The post included the phrase “See Ya Later Race Traitor”.

Szewczuk was ordered to be detained in a young offenders’ institution after pleading guilty to two counts of encouraging terrorism and five counts of possession of terrorist material, including the White Resistance Manual and the Al Qaeda Trading Manual.

Michal Szewczuk (West Yorkshire Police/PA)

The 19-year-old, of Wyther Park in Bramley, Leeds, also wrote an “extremely violent and aggressively misogynistic” blog which attempted to justify the rape of women and children in the pursuit of an Aryan race.

Szewczuk was sentenced at the Old Bailey alongside 18-year-old Oskar Dunn-Koczorowski, from St Albans Avenue in west London, who had admitted two counts of encouraging terrorism.

Referring to the image of Harry, the judge said: “The posts I have seen and read are abhorrent as well as criminal by reason of their clear intention to encourage terrorist acts.”

She told Szewczuk: “Individuals were urged to go out and commit appalling acts of violence on others for no reason that can ever be understood by any right thinking individuals.”

Handing Dunn-Koczorowski an 18-month detention and training order, she said: “You still hold deeply entrenched views in support of this extreme right-wing ideology.”

The defendants were both said to be of Polish decent but had only ever met in online chatrooms.

They were arrested in December after posting images or links to Gab, a social media platform which attracts mainly far-right users, last summer, the content of which was influenced by extreme far-right groups.

One of those, Atomwaffen Division, is described as “a youth-driven, national socialist group at the extreme end of the revolutionary right-wing spectrum” and has been linked to five murders in the US since 2017, the court heard.

Oskar Dunn-Koczorowski (West Yorkshire Police/PA)

Dunn-Koczorowski, whose posts included support for far-right terrorist Anders Breivik and the threat of ethnic cleansing of Albanians, demonstrated a “highly radicalised and violent mindset”, the court was told.

His lawyer, David Kitson, admitted that Dunn-Koczorowski’s mindset had not changed since the offences were committed, quoting from a medical report which said the teenager had a “lack of remorse” for his views and a “deeply entrenched ideology”.

Prosecutor Naomi Parsons said the posts, made across three accounts by the two youths “convey a message of the threat of and/or use of serious violence against others, in order to advance a political, ideological and racial cause (neo-Nazism) and in this way encourage terrorism”.

She told the court that targets included Jewish people, non-white people and anyone “perceived to be complicit in the perpetuation of multi-culturalism”.

Dunn-Koczorowski was just 17 at the time of the offences and was living at home.

Szewczuk, who was arrested at his halls of residence during his first year studying computer science at Portsmouth University, had a “difficult and disordered upbringing” and had suffered with depression “for a considerable period”, his lawyer, Adam Morgan, said.

The court heard that he moved to the UK from Poland at the age of 10, living first in Northern Ireland, and then England.

The defendants appeared in court via video-link from Belmarsh Prison and gave no reaction as they were sentenced.

Detective Chief Superintendent Martin Snowden, of Counter Terrorism North East, said: “Dunn-Koczorowski and Szewczuk clearly see themselves as superior to the majority of society and they feel their duty is to express their beliefs, in turn teaching others.

“The considerable amount of material they have posted on social media channels not only reflects their extremist beliefs but was intended to encourage others to carry out despicable acts.

“Both men have developed and evolved their interest in the extreme right-wing ideology over time through research and connecting with like-minded individuals.”