Harry, 40, the younger son of King Charles, had been suing News Group Newspapers (NGN), publisher of The Sun and the now-defunct News of the World, at the High Court in London, alleging the papers had illegally obtained private information about him from 1996 till 2011.
NGN also admitted it had intruded into the private life of Harry's late mother, Princess Diana.
Lawyer David Sherborne has read out a statement from Prince Harry outside the High Court. (AP PHOTO)
A source familiar with the settlement said the damages involved an eight-figure sum.
"In a monumental victory today, News UK have admitted that The Sun, the flagship title for Rupert Murdoch's UK media empire, has indeed engaged in illegal practices," Harry and his co-claimant Tom Watson said in a statement.
"Today the lies are laid bare. Today, the cover-ups are exposed. And today proves that no one stands above the law. The time for accountability has arrived," said the statement, read by their lawyer David Sherborne outside the High Court.
The trial to consider Harry's case, and a similar lawsuit from former senior MP Watson, had been due to start on Tuesday but following last-gasp talks, the two sides reached a settlement, with NGN saying there had been wrongdoing at The Sun - something it had denied for years.
"NGN offers a full and unequivocal apology to the Duke of Sussex for the serious intrusion by The Sun between 1996 and 2011 into his private life, including incidents of unlawful activities carried out by private investigators working for The Sun," Sherborne told the court.
"NGN further apologises to the Duke for the impact on him of the extensive coverage and serious intrusion into his private life as well as the private life of Diana, Princess of Wales, his late mother, in particular during his younger years."
It also admitted targeting Watson, including when he was a junior minister under then prime minister Gordon Brown, who had been due to give evidence if the trial had gone ahead.
In a statement, an NGN spokesperson said its apology was for the unlawful actions of private investigators working for The Sun, not of its journalists.
"There are strong controls and processes in place at all our titles today to ensure this cannot happen now. There was no voicemail interception on The Sun," the spokesperson said, adding that the settlement marked the likely end of any lawsuits and that future cases were liable to be thrown out.
NGN has paid out hundreds of millions of pounds to victims of phone-hacking and other unlawful information gathering by the News of the World, and settled more than 1300 lawsuits involving celebrities, politicians, well-known sports figures and ordinary people who were connected to them or major events.
In their joint statement, Harry and Watson said NGN had paid out more than 1 billion pounds ($A2 billion) in total.
NGN previously always rejected any claims that there was wrongdoing at The Sun newspaper, or that any senior figures knew about it or tried to cover it up, as Harry's lawsuit alleges.
Harry said his mission was to establish the truth and for the publishers' executives and editors to be held to account, after other claimants settled cases to avoid the risk of a multi-million pound legal bill that could be imposed even if they had won in court but had rejected NGN's offer.
Harry's main target had been Rebekah Brooks, who was editor of The Sun for part of the period when NGN has admitted there was unlawful behaviour and is now the chief executive of News UK.
"They now admit, when she was editor of The Sun, they ran a criminal enterprise," Harry and Watson's statement said, adding they wanted the police and parliament to investigate "the perjury and cover-ups".
However, NGN's apology made no direct reference to any wrongdoing by its senior figures, nor to the allegation that there had been any cover-ups by current or former executives.