The allegation was part of the witness statement filed by the duke in a preliminary hearing against News Group Newspapers (NGN), in which he also alleged that Prince William made a secret deal with the publishers to privately settle his own phone hacking claim and to avoid the possibility of appearing as a witness in a legal case.
Harry's witness statement said: "The Sun (through its journalist, James Beal, who I now know regularly stalked me in the UK and abroad to places such as Jamaica) instructed an American private investigator, Danno Hanks (who has admitted to regularly carrying out work for NGN over a number of years), to obtain private information in the form of a report about my new relationship with Meghan.
"This information, which included highly sensitive information such as her social security number (and other details about her and her family), was unlawfully obtained by Mr Hanks in the full knowledge of the Editors of The Sun."
Harry said that this meant The Sun obtained private information, which could be seen in two articles, "such as my and/or Meghan’s call records (to establish how many texts I had sent her), flight details and so on."
This means, Harry claims, that "unlawful activity isn’t as ‘historic’ as NGN claims" and that the company has not changed since the phone hacking scandal saw the closure of the News of the World.
NGN told Yahoo News in a statement: "In 2012, an unreserved apology was made to all of those who had brought cases against the News of the World for voicemail interception. Since then, NGN has been paying financial damages to those with claims.
"There are a number of disputed claims still going through the civil courts some of which seek to involve The Sun. The Sun does not accept liability or make any admissions to the allegations.
"As we reach the tail end of litigation, NGN is drawing a line under disputed matters, some of which date back more than 20 years ago.
"All of these matters are historical, dating back to a period between 1996 and 2012."
Harry's witness statement was filed as part of a preliminary hearing that began on 25 April, in which the publishers of The Sun tried to get a case brought against them by Prince Harry and other claimants including Hugh Grant thrown out.
The case is part of Harry’s long-term campaign to reform the British media in what he has previously called his “life’s work”.
Harry has made claims about deals made between the palace and the Murdoch owned paper before, but this witness statement saw him go into more detail.
In March, court filings in another claim he brought against the publishers of the Daily Mail – Associated Newspapers – alleged that royals had made a deal not to sue the paper over the phone hacking scandal.
Harry claimed this was because starting litigation could mean a member of the Royal Family ending up in the witness box which “could open up a can of worms”.
The witness statement also saw Harry say that “the whole country is doomed” if Associated Newspapers “can successfully evade justice”.
The duke also said in his statement: “The evidence I have seen shows that Associated’s journalists are criminals with journalistic powers”.
Associated Newspapers have called the claims “stale” and “preposterous smears”.
His case against The Sun was first filed in 2019 and is one of three that are currently ongoing against the British media for invasions of privacy.
A trial date is set for May in Harry’s case against Mirror Group Newspapers and will see him give evidence in person against the publisher’s alleged unlawful information gathering, which the company has denied.
The trial is expected to last six to seven weeks and will be the second appearance of Prince Harry in a British courtroom this year, as he also made a surprise appearance at the recent preliminary hearing against ANL.
Watch: The Royal Family's biggest spending sprees