A British convicted criminal was jailed for three years on Monday for plotting to kill Prince Harry.
Ashraf Islam, 31, said he had a "moral right to judge" the royal because he fundamentally disagreed with the work of the British military, of which Prince Harry is a member.
The judge at Isleworth Crown Court in London described Islam's plot as "vague and unlikely to succeed", but said he presented a risk to the public.
Islam, a Muslim convert, pleaded guilty in May to making a threat to kill the prince, the younger son of heir to the throne Prince Charles and younger brother of Prince William.
He had earlier handed himself in to police and volunteered the information about the plot, defence counsel Roxanne Morrell said.
Judge Richard McGregor-Johnson said he would not go over details of Islam's plot, but told the court during the brief hearing: "This was not a threat made in isolation.
"The examination of your computer revealed you conducted research on his (Prince Harry's) whereabouts and intentions.
"You had given the matter considerable thought."
He added: "The reason behind that is that you thought he and other serving officers had some moral guilt, and you thought you had a moral right to judge.
"I accept that there is nothing here that could be described as professional plans as to your expressed intentions.
"Your plan was vague and unlikely to succeed."
But the judge said police would have intervened had Islam, who has previous convictions for dishonesty and for involvement in an attempted robbery, attempted to carry out his plan.
Harry has served two tours of duty in Afghanistan but last month he gave up flying army helicopters to take up a desk job in the military.