The Duke of Sussex was branded a "race traitor" and pictured with a gun to his head in an image posted online by an extremist Leeds teenager.
The image of Harry, against a blood-spattered background and featuring a swastika, was shared on a far-right social media platform last year.
Michal Szewczuk, who is being sentenced for two counts of encouraging terrrorism and five counts of possession of terrorist material, searched "Meghan Markle", "Prince Harry" and "pointing gun" before creating the image and sharing it in August.
It included the phrase "See Ya Later Race Traitor".
READ MORE: Leeds drug dealer found with £10,000 worth of cocaine in his underwear
Judge Rebecca Poulet QC said the image "advances violence".
She said: "It is not just something that is deeply unpalatable. It encourages terrorism."
Szewczuk, 19, of Wyther Park in Bramley, Leeds, sipped water and gave no reaction in the dock at the Old Bailey, while quotes from his blog justifying the rape of women and children to further an Aryan race were read aloud to the court.
He is being sentenced alongside Oskar Dunn-Koczorowski, 18, for encouraging terrorism by posting images or links to Gab, a social media platform which attracts mainly far-right users, last summer.
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 heard.
Prosecutor Naomi Parsons said the posts, made across three accounts by the two teenagers "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 targets included Jewish people, non-white people and anyone "perceived to be complicit in the perpetuation of multi-culturalism".
Dunn-Koczorowski, 18, from St Albans Avenue in west London, is being sentenced for two counts of encouraging terrorism.
The court heard a doctor's report which described Dunn-Koczorowski, who works as a labourer for a construction company, as an "emotionally and psychologically damaged young man" who has a "lack of remorse" for his views and a "deeply entrenched ideology".
In mitigation for Szewczuk, his lawyer Adam Morgan said his client had a "difficult and disordered upbringing" and had suffered with depression "for a considerable period".
The court heard he moved to the UK from Poland aged 10, living first in Northern Ireland and then England.
The teenagers were remanded in custody as Judge Poulet adjourned sentencing until Tuesday morning.
Szewczuk, who was arrested in December at his halls of residence during his first year studying computer science at Portsmouth University, pleaded guilty in April to possession of documents including the White Resistance Manual and the al Qaida Manual.
Dunn-Koczorowski, who was arrested at his west London home on the same day last year, admitted the charges against him in December.