LONDON — Prince Harry’s announcement of a lawsuit against the parent company of a U.K. newspaper, and an emotional statement criticizing coverage of him and his wife, landed like a bombshell on Tuesday.

The Duke and Duchess of Sussex were coming to the end of a 10-day tour to Africa where they received largely positive media coverage by both the British and international press.

What lies behind the prince's scathing statement, which accused British tabloids of waging a "ruthless campaign," is months of negative stories in the press about the couple, and Meghan Markle in particular.

Harry said the lawsuit had "been many months in the making," during which a "press pack that has vilified her almost daily" and created "lie after lie at her expense" during her maternity leave.

In the lead-up to couple's wedding they were the darlings of the press. “Meghan Markle is all smiles after her whirlwind two days with Prince Harry,” the Daily Mail proclaimed in December 2016. “Prince Harry 'thrilled' over Meghan Markle engagement,” it wrote in 2017.

But around the time of their wedding in May 2018, and in the months that followed, the media coverage of the duke and duchess became more critical.

Newspapers ran stories about Meghan's estrangement from her father and half siblings. Articles quoting anonymous sources claimed said she demanded a certain tiara for her wedding and had banned Prince Harry from the royals’ traditional pheasant shoot the day after Christmas. Another said Harry was fighting with his brother, Prince William.

"Frown Jewels: Meg is banned by Queen from using Di gems," said one front page headline from The Sun newspaper.

Harry, the grandson of Queen Elizabeth II, initiated legal proceedings against the Mail on Sunday and its parent company Associated Newspapers, over the publishing of a private letter.

The statement didn't specify which letter, but the Mail on Sunday published a handwritten letter sent by Markle to her estranged father, Thomas Markle, in February.

This was published "in an intentionally destructive manner" and it was edited in a misleading way, the Sussexes claim.

The newspaper said it stands by the story and it denied that "the letter was edited in any way that changed its meaning.”

“It’s typical of the tabloid press that they deal in extremes,” said Steven Barnett, a professor of communications at the Westminster School of Media and Communication. “First, everything is wonderful, they’re an amazing couple, they represent everything great about diversity and internationalism. When they find something to criticize they go to the other extreme.”

In contrast to the way that William and his wife Kate have allowed the media into their lives in controlled doses, including just after the birth of their three children and on their children’s first day of school, Harry and Meghan have closely guarded their privacy.

They kept the location of the birth of Archie, their first child, a secret and didn’t release the names of his godparents.

The Daily Mail then revealed that the baby shawl Meghan used for Archie “is made in Indian factory where some dirt poor workers earn just 37p an hour.”

Prince Harry and his wife Meghan, meet Graca Machel, the widow of the late Nelson Mandela, in Johannesburg, South Africa, on Wednesday. Chris Jackson / Reuters

“What’s at the core of this, is the fact that the duke and duchess are trying to balance their desire for a private life, while living in a highly transparent media world,” said Laura Toogood, an expert on digital media issues.

“They aren’t the same as celebrities who fund their activities privately or commercially. One of the reasons it’s such a talking point in the media is because taxpayers’ money is involved,” she added.

The media has also picked up on ways that the couple's lifestyle appears at odds with the causes they promote, such as the environment.

Over the summer, Prince Harry was criticized for taking private jets, which burn more environmentally harmful fuel per person than commercial flights.

“They have to be aware of how it can be perceived when they don’t align their lifestyle with what they talk about,” said Toogood. “The Cambridges seem to balance the private and public well. They keep their private and public life running in harmony.”

Despite the negative headlines, Prince Harry is the second most popular royal, behind only the queen, according to YouGov. Meghan comes in at number seven.

Barnett believes that even with the negative media coverage, Harry will find support and even sympathy from the British public after his statement.

“I think the tabloids might find it more difficult than they did with his mother [Diana] in pursuing this vindictive course,” he said.