The Queen once plotted to hit the Ugandan dictator Idi Amin over the head with a ceremonial sword, according to a new set of archives.

Lord Mountbatten’s diary from 1977 reveals how the monarch was concerned Amin might “gatecrash” her Silver Jubilee.

Throughout the 1970s the Queen was warned of how damaging it would be if she was seen with a “Commonwealth head of government known to be a murderer”, and “elaborate contingency plans” were drawn up by the security services in case the dictator ever tried to attend with other leaders.

Download the new Independent Premium app Sharing the full story, not just the headlines

According to extracts of the memoir published in Monarchy and the End of Empire, Lord Mountbatten said he asked the Queen why she looked “rather cross and worried” during the Jubilee service at St Paul’s Cathedral.

“She laughed and said, ‘I was just thinking how awful it would be if Amin were to gatecrash the party and arrive after all’.

“I asked her what she had proposed to do and she said she had decided she would use the City’s Pearl Sword which the Lord Mayor had placed in front of her to hit him hard over the head with.”

Professor Philip Murphy, who wrote the book after accessing the archives in his role as director of the Institute of Commonwealth Studies, admitted Lord Mountbatten’s choice of words could be taken with “a pinch of salt”, but said they paint a picture of the threat posed by the infamous dictator at the time.

Prof Murphy said the anecdote is one of many showing the role the Queen played in maintaining peace within the Commonwealth.

He told the Telegraph the monarch became “increasingly important” in holding countries together, and had helped smooth diplomacy simply “by virtue of being there”.

Monarchy and the End of Empire is published by the Oxford University Press.