Impressionist Rory Bremner "saved John Major's bacon" when he inadvertently thwarted a Tory revolt against him, newly released files show.
Documents from the National Archives tell how Bremner impersonated the then-PM when he phoned Eurosceptic Tory MPs in 1993, asking for their support.
They had planned to challenge Sir John's leadership at the time of the Conservative conference in Blackpool.
But the lead rebel thought it was the PM phoning and abandoned the revolt.
Bremner, who made the calls in September 1993 for his new Channel 4 show, has since said he had no idea he had helped to thwart a rebellion 27 years ago.
He said: "You think you're being satirical but the reality is even more farcical.
"Honestly, who'd have thought that without a spoof phone call, a group of Eurosceptic backbenchers might have forced the prime minister to resign and taken us out of the EU. What are the chances of that?"
On 21 September 1993 at about 16.00 in the afternoon, top Eurosceptic MP Sir Richard Body received a phone call from someone he believed was the then-prime minister.
Sir Richard said the caller was "frantic", in a great hurry, and asking for the Eurosceptics' support.
With a House of Commons majority of just 18, Sir John was under constant pressure from the Eurosceptic right.
Sir Richard was convinced the caller was Sir John, telling Cabinet Secretary Sir Robin Butler that "if it had been an actor he would have been at the very top of his profession".
Sir Richard rang fellow Eurosceptic John Carlisle who said he had received a similar call.
They and their allies had been planning to challenge the prime minister at time of the annual Conservative Party conference that autumn.
But after the calls, they decided to "take the heat off".
They spoke to their - unofficial -"whips to ensure that others in their group did the same.
But it was Bremner who had called the MPs, gathering material for his new show.
He and his production team wanted to see whether his impression of the prime minister would "fool anyone".
To his surprise, Mr Carlisle seemed to believe him and Bremner then called Sir Richard.
Bremner could tell the MP believed he was talking to the PM.
"It's like being a safe cracker," he told the BBC. "Suddenly - the doors open and you're in."
Mr Carlisle had told another MP, Graham Bright, about the phone calls and the cabinet secretary investigated. A fortnight after the calls, he phoned both MPs.
Sir Richard was insistent it had been the real prime minister. According to an official note of their conversation, Sir Richard told the cabinet secretary that the call had "saved [Sir John's] bacon".
The cabinet secretary then called Michael Grade, then-chief executive of Channel 4.
He told him that in his view and that of the PM the calls had "crossed the boundary between entertainment and real life to an unacceptable degree".
He asked for assurances these calls would not be broadcast, and no new calls would be made.
The next day, Grade confirmed none of the calls to MPs would be broadcast, and that any future calls would require his permission - which he would not give if they "touched on political matters".
Sir Robin accepted this, and the PM seemed satisfied with it as well. Only two copies of the note were kept - and nothing was put in writing to Mr Grade.
A week after his conversation with the cabinet secretary, Sir Richard called No 10, apologising for being taken in.
The file shows the PM himself placed two ticks on the note and added: "Good".