A lawyer for Prince Harry is challenging the U.K. government’s decision to strip him of his security detail after he gave up his status as a working royal and moved to the United States.

Prince Harry claims his safety is jeopardized because of hostility toward him and his family on social media and in the press.

His attorney, Shaheed Fatima, said the group that evaluated Prince Harry’s security needs – known by the acronym of its former name, the Royal and VIP Executive Committee, or RAVEC – treated him unfairly and failed to follow its own policies that required risk analysis about the Duke of Sussex’s safety.

"RAVEC should have considered the ‘impact’ that a successful attack on the claimant would have, bearing in mind his status, background and profile within the royal family – which he was born into and which he will have for the rest of his life," Fatima said. "RAVEC should have considered, in particular, the impact on the U.K.’s reputation of a successful attack on the claimant."

KING CHARLES STRIPPED PRINCE HARRY, MEGHAN MARKLE'S SECURITY AS REVENGE FOR LEAVING ROYAL FAMILY: REPORT

Close up of Prince Harry

Prince Harry is challenging the U.K. government's decision to strip him of his security detail after he gave up his status as a working royal. (Lukas Schulze/Getty Images for Invictus Games Düsseldorf 2023)

The 39-year-old wasn’t in court as attorneys presented opening remarks for the three-day hearing in London’s High Court. A judge is expected to rule at a later date.

"He should be placed in a bespoke position and that bespoke arrangements be… specifically tailored to him," government attorney James Eadie said. "He is no longer a member of the cohort of individuals whose security position remains under regular review."

The committee considered the wider impact the "tragic death" of his mother, 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 him to happen, Eadie said.

Eadie also said there was a cost factor, because security funds aren’t unlimited. He noted that Harry has been granted protection for certain events, such as his visit in June 2021 when he was chased by photographers after attending a charity event for seriously ill children at Kew Gardens in west London.

PRINCESS DIANA'S BODYGUARD ON PRINCE HARRY AND MEGHAN MARKLE'S CAR CHASE: 'ONLY GETTING A PART OF THE STORY'

Holding a microphone, Prince Harry speaks to the crowd at the Invictus Games Closing Games in the Netherlands, wearing a dark blue suit and royal blue shirt

The Duke of Sussex has claimed the committee in charge of the decision unfairly canceled his security request and included a former private secretary to Queen Elizabeth II, with whom he'd had "significant tensions." (Chris Jackson/Getty Images for the Invictus Games Foundation)

Harry said the committee unfairly nixed his security request without hearing from him personally and didn’t disclose the panel’s composition, which he later learned included royal family staff. He said Edward Young, the assistant private secretary to the late Queen Elizabeth II, shouldn’t have been on the committee because of "significant tensions" between the two men.

The Home Office has argued that any tensions between Harry and the royal household staff were irrelevant and that the committee was entitled to its decision, because he had relinquished his role as a working member of the family.

Representatives for the Sussexes did not immediately respond to Fox News Digital's request for comment.

Lee Sansum, who once served as Princess Diana’s bodyguard, said Harry should be allowed to hire his personal security to protect him while he and his family are in the U.K. 

"Harry has been in the military," Sansum previously explained to Fox News Digital. "He’s got a good understanding of security. I imagine he’s pretty switched onto all [the dangers]. But if he wasn’t, I would suggest he does. I would hate to be in his position, but I think being in the States is the best place for him to be. It’s probably the safest place for him to be, I would think."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER 

Princess Diana and Prince Harry catch British Grand Prix together

Princess Diana's former bodyguard told Fox News Digital that he believes Prince Harry is safest in the United States. (Coventry Telegraph Archive)

The ex-military policeman noted that with social media, there are even more risks to consider than what existed during Diana’s lifetime. 

"As you know, many people live their lives on social media," he explained. "You have keyboard warriors and all these trolls on there. You can’t ignore the threats. I would suggest that he take a course that could help him get a more technical handle on his security, but I’m sure his protection team is ultimately professional anyway."

Earlier this year, Prince Harry lost his challenge to make private payments to police for protection while in the U.K.

He claimed he doesn’t feel safe bringing his wife, Meghan Markle, and young children, Archie, 4, and Lilibet, 2, from the U.S. to visit his home country without proper police security.

LIKE WHAT YOU’RE READING? CLICK HERE FOR MORE ENTERTAINMENT NEWS

Prince Harry and Meghan Markle arrive at an event in New York City

During his earlier legal battle to make private payments to police for protection while in the U.K., Prince Harry claimed he didn't feel safe for himself, Meghan Markle, or their children, while in the country. (Reuters/Mike Segar)

A spokesperson for the prince has said his U.S. security team doesn’t have jurisdiction abroad or access to intelligence in the U.K.

A lawyer for the government argued in court that it was not appropriate to allow hiring "police officers as private bodyguards for the wealthy."

CLICK HERE TO GET THE FOX NEWS APP

The Associated Press contributed to this report.