LONDON — Prince Harry, who fled Britain complaining about media coverage, has signed a book deal as the latest part of an effort to control his own narrative.

Penguin Random House said it will publish a literary memoir by Harry late next year that will offer a “definitive account” of his life, from his childhood to the present.

Harry said he was “excited for people to read a firsthand account of my life that’s accurate and wholly truthful” — a clear jab at the media accounts he has objected to.

“I’m writing this not as the prince I was born but as the man I have become,” Harry, 36, said in a statement.

“I’ve worn many hats over the years, both literally and figuratively,” he said, “and my hope is that in telling my story — the highs and lows, the mistakes, the lessons learned — I can help show that no matter where we come from, we have more in common than we think.”

The publisher did not disclose the financial terms of the deal, but some publications said the advance was in the region of $20 million. Harry said he would donate the proceeds to charity.

Several British tabloids reported that the book will be ghostwritten by J.R. Moehringer, a Pulitzer Prize-winning journalist who collaborated with Andre Agassi on his memoir, “Open.”

Penguin Random House also produced “The Bench,” a children’s book about father-son relationships by Harry’s wife, Meghan, Duchess of Sussex.

There will also be an audio edition of Harry’s book. The publisher did not reveal who would do the narration.

It is highly unusual for a central member of the British royal family to produce a memoir. A few semidetached members of the family have written memoirs, including Sarah Ferguson, the Duchess of York and ex-wife of Prince Andrew, who wrote “My Story.” 

The most recent example comparable to Harry’s project is arguably the 1951 memoir “A King’s Story” by Edward, the Duke of Windsor, who abdicated the throne to marry American Wallis Simpson. 

Normally, a distinguished historian is tapped to write an official biography after a senior royal has died. For instance, Queen Elizabeth II appointed historian William Shawcross to write her mother’s official biography.

Harry’s parents never wrote memoirs, but they did support authors who wrote books about them. Harry’s father, Prince Charles, assisted Jonathan Dimbleby with a biography, which was published alongside a documentary. Harry’s mother, Princess Diana, cooperated — covertly — with Andrew Morton on his book, “Diana: Her True Story.” Diana initially said she had nothing to do with the book.

Harry has indicated a strong interest in controlling how his story is told. In recent interviews with Oprah Winfrey and the “Armchair Expert” podcast, he has spoken about family, money and royal life.

Robert Hardman, a royal biographer, told The Washington Post he expected Harry’s memoir to especially focus criticism on the media.

“My hunch is that the royal family will probably take a few hits, but they’re kind of used to that and they’ll get over it,” Hardman said. “I think the officials will take some fairly heavy shelling and the media are in for a kind of thermonuclear all-out attack.”

Hardman added that despite family rifts provoked by the Winfrey interview, Harry “doesn’t want to burn bridges and blow up that relationship.” He noted that earlier this month, Harry joined his brother, Prince William, at Kensington Palace to unveil a statue of their late mother, Diana.

Others suggested that the royal family could be in for a rough ride. Angela Levin, author of a biography on Prince Harry, told “Good Morning Britain”: “If it’s going to be ‘intimate,’ as he says, I feel he risks looking like a traitor to the royal family. I can’t believe it’s going to be all honey and sweetness.”

On Twitter, Penguin Random House said: “In an intimate and heartfelt memoir from one of the most fascinating and influential global figures of our time, Prince Harry will share, for the very first time, the definitive account of the experiences, adventures, losses, and life lessons that have helped shape him.”

The publisher said the book would cover “his lifetime in the public eye from childhood to the present day, including his dedication to service, the military duty that twice took him to the frontlines of Afghanistan, and the joy he has found in being a husband and father.”