LONDON - Former News of the World editor Rebekah Brooks -- a pivotal figure in Britain's tabloid phone hacking saga -- said Friday that Prime Minister David Cameron commiserated with her after she quit in the wake of the scandal.

The 43-year-old Brooks, who resigned in July as chief executive of News International, Rupert Murdoch's British newspaper operation, told the country's media ethics inquiry of her close ties to those in power.

Known for her striking red curls and meteoric rise from junior employee to editor at News of the World, Brooks acknowledged she had messages of support from politicians including Cameron and ex-Prime Minister Tony Blair when she stepped down.

Brooks denied that politicians cultivated her friendship because she was a key conduit to Murdoch, but acknowledged her position offered wide access to political leaders, police chiefs and other British powerbrokers.

CLOSE TO CAMERON

Brooks said Cameron is a personal friend and neighbour in the picturesque Cotswolds area of southern England -- and acknowledged she even offered him advice on text messaging.

After she stepped down amid the phone hacking scandal, Brooks said she had received "indirect messages" of support -- text messages sent by politicians' aides that relayed the politicians' personal thoughts -- including from Cameron.

"I received some indirect messages from No. 10, No. 11, the Home Office and Foreign Office," Brooks said, referring to Cameron, Treasury chief George Osborne and other leading Cabinet members.

She agreed with inquiry lawyer Robert Jay that a message from Cameron had told her to "keep your head up" and expressed regret that he could not be more loyal because of the political pressure he was under over the hacking scandal.

The message was "along those lines, I don't think they were the exact words," Brooks said.

Brooks said she and Cameron would trade texts at least once a week, or twice a week during busier periods such as Britain's 2010 national election.

"He would sign them off 'DC,"' said Brooks, who showed both composure and frequent flashes of humour as she testified. "Occasionally he would sign them off LOL, 'lots of love', until I told him it meant 'laugh out loud."'

Brooks confirmed that she had discussed tabloid phone hacking with Cameron, but "not very often, once or twice ... it kept coming up, so we would bring it up."

Those conversations had taken place after the revelations that the News of the World had hacked murdered schoolgirl Milly Dowler's phone when she disappeared in 2002. She was later found dead.

Public revulsion at the tactics deployed to pursue the schoolgirl led Murdoch to shut down the 168-year-old News of the World in July, and saw Cameron set up the ethics inquiry, led by Lord Justice Brian Leveson.

Brooks also detailed about 20 formal meetings with Cameron between 2005 -- when he became leader of the then-opposition Conservative Party -- and 2011.

Cameron has previously acknowledged that he has known her husband for 30 years and that he had ridden on a retired police horse that had been loaned to Rebekah Brooks.

BUDDY OF THE BLAIRS

Blair, who quit as prime minister in 2007, also sent a message of support to Brooks when she quit and was a longtime ally, Brooks disclosed.

In a written statement to the inquiry, Brooks said "Tony Blair, his senior Cabinet, advisers and press secretaries were a constant presence in my life for many years."

"I became close friends with his wife Cherie Blair ... and also with the Blairs' closest advisers, including Alistair Campbell and his partner Fiona Miller."

In 2003, when she was editor of Murdoch's The Sun tabloid, she offered her newspaper's support for Britain's role in the U.S.-led invasion of Iraq.

"During the Iraq war, I spent more time than usual talking to Tony Blair and Downing Street," she said. Public opinion was divided in Britain over the war, with large numbers opposed to Blair's decision to join the conflict.

Brooks detailed at least 12 dinners -- three when they ate alone -- and drinks meetings with Blair between 2005 and 2007 and said he'd been among the political heavyweights who attended her 40th birthday party, which was hosted at Murdoch's home.

BUT ANGER FROM GORDON BROWN

Murdoch's newspapers turned their back on the Labour Party before Britain's 2010 election, offering backing instead to Conservative Party leader Cameron.

Although Blair -- who led Labour -- remained friendly, his successor as prime minister and party chief, Gordon Brown was "incredibly aggressive and angry," after The Sun switched its political allegiance.

Brown hadn't sent any message after she quit. "He was probably getting the bunting out," Brooks joked with a smile.

However, his wife Sarah Brown was "an amazing lady" and a friend who was part of a social circle that also included Brooks, Murdoch's daughter Elisabeth Murdoch and his wife Wendi Deng.

The ex-editor acknowledged she'd sided with Blair amid Brown's manoeuvring to oust his colleague as Britain's leader.

AT THE HEART OF THE SCANDAL

Brooks, a former editor of both The Sun and the News of The World, has twice been arrested and questioned by police about illegal eavesdropping and obstruction of justice. She is currently on police bail pending further inquiries, but has not been charged with any offence.

Before stepping down, she was regarded as Murdoch's key lieutenant in Britain.

As he arrived in London to handle the fallout from the hacking scandal last year -- and before she quit -- Murdoch told reporters his priority was "this one," gesturing toward Brooks.

In a report earlier this month, legislators sharply criticized Brooks for overseeing a culture at the News of The World that permitted illegal acts at her newspaper, particularly in the Dowler case.

MINISTER IN TROUBLE?

Brooks offered a potentially damaging new disclosure over a Cabinet minister's handling of a decision on whether News Corp. should be authorized to take full control of British Sky Broadcasting, a satellite broadcaster in which Murdoch's company already holds a 39 per cent stake.

Culture Secretary Jeremy Hunt had been supposed to be acting as an impartial judge to decide whether to approve the takeover or refer it to regulators.

The ethics inquiry previously published 163 emails sent by News Corp. lobbyist Frederic Michel on the takeover bid, which alleged that either Hunt or his office had leaked sensitive information to Murdoch's company and had indicated their support of the News Corp. case. An adviser to Hunt has since resigned.

Brooks said that in an email she had received, Michel claimed that Hunt had asked him to "advise privately" to help "guide his and No.10's (Cameron's office) positioning." However, she acknowledged she believed the lobbyist sometimes exaggerated.

Murdoch dropped the takeover bid for BSkyB in mid-2011, after the furor over phone hacking. Hunt is scheduled to give evidence to the inquiry.