• News Prince William has pulled out of a memorial service because of a personal matter

Prince Harry was not improperly stripped of his publicly funded security

detail during visits to Britain after he gave up his status as a working member of the royal family and moved to the US, a London judge ruled Wednesday.

Justice

Peter Lane

said in the High Court that the decision to provide security to Harry on a case-by-case basis was not unlawful, irrational or unjustified.

The Duke of Sussex claimed he and his family were endangered when visiting the UK

because of hostility toward him and his wife on social media

and relentless harassment by news media.

His lawyer argued that the government group that evaluated

Harry's security needs acted irrationally and failed to follow its own policies

that should have required a risk analysis of the duke's security.

A government lawyer said Harry had been treated fairly and was still provided protection on some visits, citing a security detail that kept him

in June 2021 when he was chased by photographers after attending an event

with seriously ill children at Kew Gardens in west London.

The committee that made

the decision to reject his security request considered

the wider impact that the "tragic death" of his mother, the late Princess Diana, had on the nation, and in making its decision gave greater weight to the "likely significant public upset "were a successful attack" on her son to happen, attorney James Eadie said.

Harry, 39, the youngest son of King Charles III, has broken ranks with royal family tradition in his willingness to go to court to challenge both the government and take on tabloids in his effort to hold publishers accountable for harassing him throughout his life.

The lawsuit

was one of six cases Harry has brought in the High Court

.

Three were related to his security arrangements and three have been against tabloid publishers for allegedly hacking phones and using private investigators to snoop on his life for news stories.

In his first case to go to trial,

Harry won a big victory last year against the publisher of the Daily Mirror

over phone hacking allegations, winning a judgment in court and ultimately settling remaining allegations that were due to go to trial.

While the settlement was undisclosed, he was to be reimbursed for all his legal fees and was due to receive an interim payment of 400,000 pounds ($505,000).

He recently withdrew a libel case against the Daily Mail over an article that said he tried to hide his efforts to continue receiving government-funded security.

Harry dropped the case after a judge ruled he was more likely to lose at trial because the publisher could show that statements issued on his behalf were misleading and that the February 2022 article reflected an "honest opinion" and was n't libelous.

Harry failed to persuade a different judge last year that he should be able to privately pay for London's police force to guard him

when he comes to town.

A judge denied that offer after a government lawyer argued that officers shouldn't be used as "private bodyguards for the wealthy."