Former UK Prime Minister Tony Blair offered to act as an "unofficial adviser" to newspaper editor Rebekah Brooks when she sought his guidance at the height of the phone-hacking controversy, prosecutors have said.

Mr Blair also allegedly advised taking sleeping pills during an hour-long conversation with Ms Brooks in July 2011.

Ms Brooks sent a summary of the conversation to boss James Murdoch in an email, the hacking trial was told.

According to Ms Brooks, Mr Blair, who stood down after a decade as prime minister in 2007, advised "no rash short-term solutions as they only give you long-term headaches".

Instead, the former News of the World (NotW) and Sun editor told Mr Murdoch that Mr Blair suggested holding an independent inquiry which would report back and clear their names in due course.

Mr Blair also allegedly told Ms Brooks: "It will pass. Tough up."

Prosecutor Andrew Edis QC read members of the jury an email Ms Brooks sent to Mr Murdoch on 11 July 2011, just days before she was arrested by police.

In it, she relayed the telephone conversation she had with the former Labour premier.

The court heard that Ms Brooks's notes of the conversation, emailed to Mr Murdoch at 4.21pm on 11 July, stated that Mr Blair recommended:

"1. Form an independent unit that has an outside junior counsel, Ken Macdonald, a great and good type, a serious forensic criminal barrister, internal counsel, proper fact-checkers, etc in it. Get them to investigate me and others and publish a Hutton-style report.

"2. Publish part one of the report at same time as the police closes its inquiry and clear you and accept your shortcomings and new solutions and process and part two when any trials are over.

"3. Keep strong and definitely sleeping pills. Need to have clear heads and remember no rash short-term solutions as they only give you long-term headaches.

"4. It will pass. Tough up.

"5. He is available for you (James Murdoch), KRM (Rupert Murdoch) and me as an unofficial adviser but needs to be between us."

Ms Brooks added: "He is sending more notes later."

The mention of a "Hutton-style inquiry" was not explained in court today, but it could be a reference to Lord Hutton's investigation into the death of government scientist David Kelly.

In the same email chain sent the day after the final edition of the NotW was published, Ms Brooks relayed to Mr Murdoch the news that circulation figures for the Sunday tabloid were still close to four million, saying: "So much for a sales boycott."

The son of media mogul Rupert Murdoch, who was chief executive of News International before Ms Brooks, replied at 3.53pm: "What are you doing on email?"

Earlier, the court heard evidence that Sally Anderson - a friend of former home secretary David Blunkett - admitted giving details of their relationship to newspapers.

The trial had previously heard furious voicemail messages left for Ms Anderson by Mr Blunkett in 2005 - while he was a member of Mr Blair's Labour government - in which the politician said he hoped whoever leaked information to the media would "rot in hell".

In one message, he said: "Someone very, very close has done a really phenomenal piece of work on destroying both our lives at this moment in time and it's vile."

But prosecutor Mr Edis read a list of agreed facts to the court, in which it was revealed that Ms Anderson and/or a friend using her phone contacted the press to tip them off about meetings between the couple - and that they had not been lovers.

Mr Edis said: "(Mr Blunkett's) comments were provoked by publishing an article in the Daily Mail about their close relationship.

"Sally Anderson had actually given information to the Daily Mail.

"A woman calling from Sally Anderson's phone also informed the media about meetings."

He said a woman calling from Ms Anderson's phone later called newsdesks asking for payment for information.

Mr Edis said the People newspaper ran an article in 2005 about Ms Anderson being pregnant with Mr Blunkett's baby before he "abandoned" her.

The court heard that the politician subsequently sued the newspaper and Ms Anderson for libel, resulting in the woman and several media outlets issuing full public apologies, denying that she and Mr Blunkett had been lovers.

"David Blunkett was not my lover and could not have made me pregnant," Ms Anderson admitted.

All defendants - including Brooks, 45, of Churchill, Oxfordshire - deny all charges in the phone hacking trial.

The prosecution case has finished and Ms Brooks's defence is expected to start tomorrow.