Rebekah Brooks sent a text message to David Cameron claiming that "professionally we are in this together" before he was elected prime minister.

Cameron has made no secret of his close friendship with the then editor of News Intetrnational tabloid The Sun but the message, released at the Leveson Inquiry into press ethics, has raised fresh questions about the extent of his links to the news organisation.

Robert Jay QC, counsel to the inquiry, read the text, which was released by News International under a Section 21 order. The message was sent in October 2009, on the eve of Cameron's speech to the Conservative party conference. Its first sentence was redacted.

"But seriously, I do understand the issue with the Times. Let's discuss over a country supper soon.

"On that party, that's because I had invited a number of NI people to Manchest post-endorsement. As always Sam was wonderful...I am so rooting for you, not just as a personal friend, but because professionally we are in this together. Speech of your life? Yes he Cam!"

New text messages have been revealed between David Cameron and Rebekah Brooks (Reuters)

The message, with its echoes of the Tory "all in this together" tagline, so often twisted by Labour leader Ed Miliband, will represent a significant embarassment to Cameron, who was left red-faced when Brooks revealed to the inquiry that he would finish his texts with "lol", meaning "lots of love" or "laugh out loud".

Throughout Cameron's evidence-giving, he admitted that press and politicians had become too close, although he blamed Tony Blair's New Labour government as the source of the rot.

He denied any sort of a "nod and wink" deal between the Conservatives and News Corporation as "nonsense", claiming that it becamse difficult to prove innocence and equated investigations with a "witchcraft trial".

The inquiry discussed a meeting that Cameron had with James Murdoch at the George club in London in September 2010, when Murdoch informed him that the Sun would switch its allegiance to the Conservative party.

David Cameron
Prime minister David Cameron has had more details of his text messages revealed. (Leveson)

Cameron described the meeting as a "drink and a catch-up" and that he was "obviously pleased" with the newspaper's decision.

"It's hard to remember all of the details of these occasions, but I definitely remember him saying that the Sun would support the Conservatives - I certainly wouldn't forget that.

"I think he gave me a hint of the time. He told me I think it was going to happen around the time of the Labour party conference."

Former prime minister Gordon Brown has denied claims made by Rupert Murdoch that the then Labour PM said the change in allegiance was an act of war in a heated phone call.

Cameron said that the Conservatives had their work cut out to win over the Sun, which Jay described as an important "floating voter".

Cameron said: "It doesn't mean that you are going to win the election, but you are certainly trying to win support."