Margaret Thatcher blocked plans to strip a paedophile diplomat of his knighthood, according to confidential Government papers published for the first time today.

The then Prime Minister allowed Sir Peter Hayman to keep his knighthood even though she knew he was a member of the Paedophile Information Exchange (PIE) and had recently been convicted of gross indecency with another man in a public toilet.

Foreign Office files obtained by this newspaper under Freedom of Information laws show that Mrs Thatcher chose to warn Sir Peter – who died in 1992 – about his future conduct rather than strip him of the knighthood.

Margaret Thatcher blocked plans to strip paedophile diplomat Sir Peter Hayman (right) of his knighthood, according to confidential Government papers published for the first time today

On July 11, 1984, Sir Robin Butler – her principal private secretary – told the Foreign Office: ‘I am writing to confirm that the Prime Minister agrees that Sir Peter Hayman should be warned that if there were any repetition of the offence for which he has recently been convicted and fined, there should be no alternative but that he should be stripped of his honours, but that no such recommendation should be put forward at the present time.’

Details of Mrs Thatcher’s intervention come just two months after The Mail on Sunday revealed that she approved a knighthood for the late Sir Cyril Smith – even though she knew police had investigated him over allegations of child sex abuse.

And in 2013 it emerged that she had tried to secure a knighthood for the disgraced DJ Jimmy Savile, even though civil servants regarded him as a ‘strange personality’.

At the time of Sir Robin’s letter, Mrs Thatcher would have been aware of both Sir Peter’s recent conviction and his links to PIE.

Sir Peter Hayman and Lady Hayman at Uxmore House, their home in Checkendon. They posed for pictures at the front door, but refused to answer questions concerning the child pornography case

In 1981 Tory MP Geoffrey Dickens had used parliamentary privilege to brand the retired diplomat a paedophile in the House of Commons. He was responding to the revelation that in 1978 the then retired Sir Peter, a father of two and former High Commissioner to Canada, had left paedophilia-related material on a bus.

The Foreign Office papers show there was strong support for stripping him of all of his honours – but suggest that Mrs Thatcher may have resisted because she wanted to avoid dragging the Queen into a scandal.

On June 27, 1984, Sir Antony Acland – the Permanent Under Secretary at the Foreign Office – told then Foreign Secretary Sir Geoffrey Howe that the calls for action would be difficult to ignore. He said that those high up in the Order of St Michael and St George – an order of chivalry – felt that ‘officers of the Order should recommend that he be stripped, since to do nothing might offend Members of the Order, and possibly members of the public.

‘The Dean of St Paul’s also took the view, because of his anxiety to protect children, although Sir Peter was not convicted of any charge in this respect.’

But he warned that stripping Sir Peter of his honours could prove problematic. ‘The matter is further complicated since Sir Peter holds the CVO – the Queen’s personal order,’ Sir Antony said.

Details of Mrs Thatcher’s intervention come just two months after The Mail on Sunday revealed that she approved a knighthood for the late Sir Cyril Smith

He added that if he were stripped of the knighthood, ‘he would have to lose the CVO and MBE also, so the Queen is to some extent already involved’.

In the papers, Sir Peter expresses shame for his actions and reveals he is being supported by his wife Rosemary and a psychiatrist.

On July 25, 1984, he wrote to a Whitehall official: ‘Let me repeat once again how bitterly ashamed I am for what I have done.’ He added: ‘Rosemary wants me to say how greatly she too appreciated all that you have said and all that you have done.’