David Cameron texted Rebekah Brooks telling her to "keep her head up" in the week that she resigned as chief executive of News International, it has been alleged.
The Prime Minister told Mrs Brooks she would get through her difficulties just days before she stood down over the phone hacking scandal, an updated biography of Mr Cameron discloses.
The contact between the pair then came to an abrupt halt, the book, Cameron: Practically A Conservative, claims.
The biography, serialised in The Times, also details how the pair would often pop round to one another's houses in south Oxfordshire.
The revelations come just days before Mrs Brooks and former Number 10 communications director Andy Coulson are expected to make embarrassing revelations about British politicians' attempts to woo Rupert Murdoch's newspapers.
There is speculation that the Leveson Inquiry could release emails and text messages sent between Mr Cameron and Mrs Brooks.
Mrs Brooks has kept all the texts she received from the Prime Minister, of which there could have been more than 12 a day, according to Daily Telegraph columnist Peter Oborne.
Mr Coulson will appear before the inquiry tomorrow, followed by Mrs Brooks on Friday, and their potentially explosive evidence could overshadow Mr Cameron's efforts to relaunch the coalition's programme after bruising local election results for the Conservatives and Lib Dems.
Mrs Brooks is likely to disclose further details about her close relationship with the Prime Minister, while Mr Coulson will speak about how he came to be appointed the Tories' top spin doctor.
Eight Cabinet Ministers - including Mr Cameron, Deputy Prime Minister Nick Clegg and Culture Secretary Jeremy Hunt - were last week given the right to see Leveson Inquiry documents and witness statements in advance.
Lord Justice Leveson agreed to make them "core participants" - people who have a significant interest in the hearings or may face criticism.
Mrs Brooks, who is 43, edited the News of the World and The Sun before becoming chief executive of Mr Murdoch's UK newspapers division News International in September 2009.
She and racehorse trainer husband Charlie are key members of the influential Chipping Norton set, which also includes Mr Cameron and his wife Samantha, Top Gear presenter Jeremy Clarkson, and Mr Murdoch's daughter Elisabeth and her PR guru husband Matthew Freud.
The inquiry has already heard that Mrs Brooks regularly met Mr Cameron and other top politicians along with Rupert and James Murdoch.
She hosted a Christmas dinner on December 23, 2010, just two days after Business Secretary Vince Cable was stripped of his responsibility for media takeovers for saying he had "declared war" on the Murdochs' News Corporation empire, and her wedding on June 13 2009 was attended by Mr Cameron and then prime minister Gordon Brown.
Mr Cameron said in March that he rode a retired police horse loaned to Mrs Brooks by Scotland Yard from 2008 to 2010.
Mrs Brooks has twice been arrested by Scotland Yard detectives investigating allegations of phone hacking, corrupt payments to public officials, and an attempt to pervert the course of justice. She was bailed and has not been charged.
The Leveson Inquiry's lawyers will not question Mrs Brooks or Mr Coulson about anything that could prejudice the continuing police investigation into phone hacking or any potential future trials.
Mr Cameron set up the Leveson Inquiry last July in response to revelations that the now-defunct News of the World hacked murdered schoolgirl Milly Dowler's phone after she disappeared in 2002.