Michael Shea, 71, had suffered a recent deterioration in his health and died with his family by his side in Edinburgh, the city he had returned to after his time at Buckingham Palace and which he served as Deputy Lieutenant.

A spokesman for The Queen said yesterday: “The Queen has been made aware of the death of Michael Shea and will be saddened at the news.”

Mr Shea joined Buckingham Palace in 1978, after a long spell in the Diplomatic Service, and travelled with the Queen to 65 different countries.

He was in place when the engagement of Prince Charles and Lady Diana Spencer was announced to the world’s media and oversaw the coverage of the subsequent Royal Wedding.

He was also at the helm when Anthony Blunt, one of the Cambridge Five exposed as a Soviet spy, was stripped of his Knighthood by the Queen in 1979.

After stepping down in 1987, he went on to serve as chairman of the Royal Lyceum Theatre, the Edinburgh Military Tattoo and the Hill Adamson Centre. He is also a former trustee of the National Galleries of Scotland and governor of Gordonstoun School, where he was educated before going to Edinburgh University, where he achieved a PhD in economics.

Eric Milligan, Lord Provost of Edinburgh and a close friend of Mr Shea’s, yesterday spoke warmly of his friend who “oozed charm” and impressed with his intelligence.

“I am sure that everybody who mattered in Scottish society was on first-name terms with him. He was quite a remarkable guy. ”

Mr Milligan and Mr Shea revived the Edinburgh Oyster Club, the thinking man’s supper club founded by economist Adam Smith.

Books by Mr Shea include Spin Doctor, The British Ambassador and From The Sidelines.

He is survived by Mona, his wife of more than 40 years, and two daughters.