A major sigh of relief for Prince Harry ... the remaining parts of his landmark civil suit against the Mirror Group Newspapers has finally been settled.

In a hearing that took place at the High Court in London Friday, the Daily Mirror's publisher has been ordered to pay substantial damages and legal costs to the Duke of Sussex over the lawsuit he filed against the MGN-owned newspapers for unlawfully gathering personal details about his life and publishing them for the world to read.

Judge Timothy Fancourt announced MGN should pay the "generic" costs to those involved in the legal action ... adding, "In this unusual case, justice is only done by awarding the claimants their costs of the generic issues."

PH's lawyer, David Sherborne, confirmed the settlement between the royal and MGN, revealing that the publisher has made an interim payment of $505,500. The final total cost has yet to be assessed.

An MGN spokesperson said in a statement: "We are pleased to have reached this agreement, which gives our business further clarity to move forward from events that took place many years ago and for which we have apologized."

You'll recall ... Judge Fancourt's ruling in December determined the company had hacked Harry's phone to a "modest extent", awarding him about $180,000 in damages.

Fancourt found that 15 of the 33 articles published by The Sunday Mirror and another paper contained information illegally gathered by hacking into Harry's personal phone between 2004 and 2009. Harry's attorney entered 147 newspaper stories into evidence -- and many of them were forensically analyzed.

TMZ Studios

During the trial, Harry testified for seven hours, making him the first senior royal to take the witness stand in centuries in a court of law.

In his 2019 lawsuit, Harry claimed the intrusions went on for years and also targeted his wife, Meghan Markle, causing them "considerable distress."

Click here for info about our online advertising practices.