LONDON — In the days before his royal wedding, Prince Harry sent text messages to his now father-in-law, Thomas Markle, pleading with him to stop engaging with the media and blaming the press for souring their relationship, court documents released Monday show.

Harry's wife, Meghan, the Duchess of Sussex, is suing Associated Newspapers, the publisher of Britain's Mail on Sunday tabloid, for breaching her privacy by printing a letter she wrote to her father.

The documents filed to London's High Court filed Friday and released on Monday show a series of text messages sent by Harry to Markle, who had been expected to walk Meghan down the aisle but who ended not attending the wedding in May 2018.

These text messages were sent days after, Markle, 75, was found to have staged paparazzi photos of himself in the run-up to the event. He has since criticized the couple in television interviews.

"Tom, Harry again! Really need to speak to u. U do not need to apologize, we understand the circumstances but 'going public' will only make the situation worse," Harry wrote on May 14, in an apparent attempt to salvage the situation.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"If u love Meg and want to make it right please call me as there are two other options which don't involve u having to speak to the media, who incidentally created this whole situation," the text reads. "So please call me so I can explain. Meg and I are not angry, we just need to speak to u. Thanks."

The prince sent another message on the same day, "Oh any speaking to the press WILL backfire, trust me Tom. Only we can help u, as we have been trying from day 1."

The document comes after Harry and Meghan issued a blunt statement to four of Britain's leading tabloids, including the Daily Mail, saying that they will have "zero engagement" with the newspapers.

Back in May 2018, Markle did not respond to Harry's texts, according to the court document, but rather issued a statement to the website TMZ that he had been hospitalized because of a suspected heart attack. This was the first time Meghan learned of the news, the document said.

"I've been reaching out to you all weekend but you’re not taking any of our calls or replying to any texts," Meghan said in a message to her father. "Very concerned about your health and safety and have taken every measure to protect you but not sure what more we can do if you don't respond…Do you need help?"

She added, "Can we send the security team down again? I'm very sorry to hear you're in the hospital but need you to please get in touch with us… What hospital are you at?"

Her father responded by declining the offer of a security team, according to the document.

The court filing alleges that the media harassed Markle and led to the breakdown in relations between him and the couple, who stood aside from front-line royal duties earlier this year. Many people in Britain and beyond feel that the pair have been victim of ruthless coverage in the press that at times has been racist.

In the document, Meghan's legal team said they published details of the messages because they claimed the defense team had provided a "selective account of these messages" in earlier filings.

In a previous statement, Associated Newspapers, the Mail's publisher, has argued it was justified printing the letter Meghan wrote to her father because, as a member of the royal family, there is "a legitimate public interest" in the "activities, conduct and standards of behavior of its members."

It also said that her father was not obliged to keep the letter private and that Meghan should have expected he might share its details with the media.

Reuters contributed to this report.