Margaret Thatcher’s chief legal adviser woke from heart surgery screaming “we must kill” Ian Paisley, newly-declassified files reveal.

Documents marked “confidential” and just released into the National Archives show a diplomat based at the Irish embassy in London reported back to Dublin about a meeting with Conservative MP Ian Gow, a close personal friend of Thatcher who was later assassinated by the IRA, and then attorney general Michael Havers.

Gow was “very depressed” at the time, in January 1987, after having resigned as treasury minister in protest over the Anglo-Irish Agreement, the diplomat reported from his meeting.

The influential Tory had stood down in solidarity with unionist leaders in Northern Ireland, but he had since considered the unionists to be “hopeless”.

There were “no signs whatsoever of any figures of stature in the wings”, he told the diplomat Richard Ryan, and had gleaned from several “good meetings” with then prime minister Thatcher that the agreement was “here to stay”.

During the meeting, the pair were joined by Havers who became a peer that year. Britain’s most senior law officer and chief legal adviser to the then Conservative government was recovering from a coronary bypass.

“Havers said that when he came out of the anaesthetic after his heart operation (his wife and the surgeons were there) he immediately shouted ‘We must kill Paisley!’.” the diplomat reports.

“He cannot explain it, he said, but ‘wouldn’t it confirm everything Paisley accuses us of?’”

The Anglo-Irish Agreement, which gave Dublin a consultative role in Northern Ireland for the first time, had sparked protests and boycotts by unionists, led by the Ulster Unionist Party’s Jim Molyneaux and the Democratic Unionists’ Ian Paisley, who denounced it as a betrayal.

Gow had worked out by this stage that Thatcher was “implacably committed to it”.

He was “very angry” at Molyneaux for “slipping off the hook” when he had tried to arrange a meeting with the taoiseach to break the ongoing impasse, adding that Molyneaux had just “chickened out”.

Gow told the diplomat that he had no “spark of hope” that he could get any of the unionist leaders to “show any courage or leadership”.

“They are all awful,” he said.

Ryan said Gow went out for couple of minutes during the meeting and Havers turned to him and asked: “What are we going to do with old Gow?”

The diplomat suggested he be given a job, and Havers replied: “Absolutely right!”

The attorney general suggested the possibility of a minister of state role “at least somewhere”, adding that it was “very important to get Gow back into the fold”.

Colleagues were very fond of him and his wife “who is apparently very distressed at what is happening to him” and they must “get him out of this nonsense”, said Havers.

Gow was killed in 1990 when an IRA bomb exploded under his car at at his home in East Sussex.