Prince William was asked to walk behind his mother's coffin at the funeral of Diana, Princess of Wales, because of fears his father, the Prince of Wales, might be attacked if he was alone, according to extracts from Alastair Campbell's newly published diaries.
The former Downing Street director of communications wrote that a Palace official was sent to Balmoral to ask William to join his father behind the coffin at the 1997 funeral.
But he said that William - aged 15 at the time - was "consumed by a total hatred of the media" because of the way his mother had been pursued, and suspected that the plan was designed to appeal to the press.
The extracts from Power and The People, published in The Guardian on Monday, also reveal that Tony Blair advised the Queen shortly after Diana's death to show her "vulnerable" side in order to win public sympathy.
Mr Campbell wrote that concerns over the Prince of Wales's safety in the wake of his ex-wife's death became clear in a conference call on September 4, 1997 with courtiers who were with the Queen and Duke of Edinburgh at Balmoral.
He said that Prince Charles' press secretary Sandy Henney was sent to Balmoral to tell William that his mother would have wanted him to follow her coffin.
"Sandy Henney had been sent up to try to explain why he might do it," wrote Mr Campbell. "She was obviously saying it was what his mother would have wanted whilst there was also the fact it would avoid the risk of Charles being publicly attacked."
He said that the Queen's deputy private secretary Sir Robin Janvrin said that if William did not follow the coffin, "then Charles couldn't 'for obvious and understandable reasons"'.
But there was doubt over whether William and his younger brother Harry would be willing to walk.
"William was refusing to speak to anyone and he was consumed by a total hatred of the media. It was pretty clear that he really felt strongly about the role of the media vis-a-vis his mother, and would not want to be doing anything that he felt was for them. He was being strong and clear about what he wanted."
He later added: "I sensed the boys were holding firm, and they seemed to feel it was being done for the media and the public, not for their mother."
Mr Campbell listened to Mr Blair's call with the Queen after Diana's death, at a time when there were signs of public discontent about the lack of open displays of emotion from the Royal Family about her demise.
"It was the first time I'd heard him one-on-one with the Queen and he really did the 'Ma'am' stuff pretty well, but was also clear and firm too," wrote Mr Campbell.
"He said he felt she had to show that she was vulnerable and they really were feeling it. He said: 'I really do feel for you. There can be nothing more miserable than feeling as you do and having your motives questioned'."