The Duke of Sussex has accepted an apology and "substantial damages" from the publisher of The Mail On Sunday and MailOnline over "baseless, false and defamatory" allegations he snubbed the Royal Marines after stepping down as a senior royal.
Harry sued Associated Newspapers for libel over two "almost identical" articles published in October, which claimed he had "not been in touch ... since his last appearance as an honorary Marine in March".
At a brief remote High Court hearing on Monday, the duke's lawyers said Associated Newspapers have accepted the allegations were false, "albeit after considerable damage was already done".
Jenny Afia, representing the duke, said Harry was donating his damages to the Invictus Games Foundation "so he could feel something good had come out of the situation".
The two articles, published on October 25, claimed "exasperated top brass" were considering replacing Harry as Captain General of the Royal Marines because he "has not been in touch by phone, letter nor email since his last appearance as an honorary Marine".
It also alleged the duke had not responded to a personal letter from Lord Dannatt, a former head of the British Army, and quoted a retired senior officer who called on Harry to "take the job seriously".
At Monday's hearing, Ms Afia told Mr Justice Nicklin that the two articles "reported that the Duke of Sussex had turned his back on the Royal Marines, had snubbed the British armed forces and ignored correspondence from Lord Dannatt, a former chief of the general staff".
She said: "All of these allegations are false, as the Mail on Sunday and the MailOnline have now accepted, albeit after considerable damage was already done.
"The truth is that the Duke of Sussex has made repeated and concerted efforts to continue to support the Royal Marines and other members of the armed forces and their families over the past year, even though he was required to step back from his formal military roles in the 'year of transition' during which he must take a reduced role as a member of the royal family.
"It is also untrue that the Duke ignored correspondence from Lord Dannatt."
Ms Afia said Harry was "proud to have served in the British armed forces for 10 years in Her Majesty's name" and "has maintained active links with those forces ever since and will continue to do so in the future".
She told the court: "The Duke's commitment to the men and women who have put their lives on the line, to those who have made the ultimate sacrifice for their country, and to military families, is steadfast and unquestionable.
"For this reason, the baseless, false and defamatory stories published in the Mail on Sunday and on the website MailOnline constituted not only a personal attack upon the Duke's character but also wrongly brought into question his service to this country."
Ms Afia added that "the publication of such allegations will unfairly tarnish and diminish the organisations with which the Duke is associated and thereby hinder the valuable work they do".
On December 27, The Mail On Sunday printed an apology, accepting the duke had been in touch with the Royal Marines, and said it had made a donation to the Invictus Games Foundation, which runs the competition for wounded, injured or sick servicemen and women set up by Harry in 2014.
But Ms Afia said the apology "used wording which significantly underplayed the seriousness of the accusations made against him" and "did not expressly acknowledge that the allegations were false".
She also said the printed apology "incorrectly stated that the defendant had made a donation to the Invictus Games Foundation".
Ms Afia added: "Although the defendant had, when making its settlement proposal, offered to directly donate the Duke's damages, the Duke wanted to bequest any damages received to Invictus Games Foundation himself so he could feel something good had come out of the situation.
"Consequently he personally is donating the damages from this case to the Invictus Games Foundation."
In a statement after the hearing, a spokesman for the Duke of Sussex said the Mail on Sunday and MailOnline articles were "completely false and defamatory".
He added: "The truth is that the Duke's commitment to the military community is unquestionable.
"Unsurprisingly, The Mail again misled their readers in December by claiming to make a charitable donation as part of an initial apology. They did no such thing.
"The Duke is personally donating the significant damages recovered from this legal resolution to the Invictus Games Foundation."