John Major was advised Rupert Murdoch was warming to the Conservative leader and vehemently opposed a Tony Blair victory at the 1997 General Election - before The Sun threw its weight behind Labour.
Briefing notes involving Downing Street aides ahead of a meeting between the prime minister and Murdoch at No 10 in September 1995 suggested the Australian newspaper proprietor was "starting to hedge his bets again" having previously given "generous space to Blair".
A note from Christopher Meyer, Major's press secretary, said: "The signal that I am picking up, mainly from The Sun, is that Murdoch has given one of his touches to the tiller. The Sun continues to give you a good press.
"The view in News International (which published The Sun) is that, while the odds are against your winning the next General Election, a Blair victory is by no means a foregone conclusion."
Meyer urged the prime minister to ensure Murdoch left Downing Street "convinced" Blair was "going to have a real fight on his hands".
A separate note from Murdoch's associate Lord Wyatt also speaks positively of Major winning The Sun's endorsement.
"I think he (Murdoch) is coming round pretty well and certainly does not want a Blair victory," it said.
The prime minister followed up the meeting by writing a letter to Murdoch inviting him and his then-wife Anna to Chequers for lunch.
The Sun newspaper came out in support of Blair in March 1997, two months before the General Election.
In a page one editorial, it described the Labour leader as the "breath of fresh air" that Britain needed, describing the Tories as "tired, divided and rudderless", and no longer deserving of support.
The Sun was markedly anti-Labour at the 1992 General Election and trumpeted the day after the Tories emerged victorious that it was "The Sun Wot Won It" - a notorious headline Murdoch later told the Leveson Inquiry was "tasteless and wrong".
Australian Associated Press