David Cameron has rejected the suggestion that he made a deal with Rupert Murdoch before the 2010 general election to secure favourable press coverage.
Giving evidence to the Leveson inquiry on Thursday, the prime minister said he did not even know News Corporation was going to launch a bid to takeover BSkyB following the election.
"This idea the Conservative Party and News International got together and said: 'you give us your support and well wave through this merger we didn't even know about is nonsense'," he said.
Cameron also said there was no suggestion of a "nod and a wink" or some sort of "covert agreement" between the Tories and News Corp.
"Of course I wanted to win over newspapers," he said. "I wanted to communicate what the Conservative Party and my leadership could bring to the country."
But he said this did not mean he promised to give media proprietors such as Murdoch a "better time" on various policies.
The prime minister also issued thinly veiled criticism of his predecessor Gordon Brown. Cameron told Leveson that when he arrived in Downing Street in May 2010 it was set up "like a newsroom" in order to engage "permanently in a news warfare mode".
He said he reorganised his private office so he was "not sitting under a 24-hour news televison screen and worrying about the ticker and what's happening every hour".
Cameron told the inquiry that his long-held views about media regulation in the UK formed when he worked for a major commercial broadcaster in the 1990s.
As he began his evidence under oath at the Royal Courts of Justice, the Prime Minister said his seven years as corporate affairs director at Carlton "was quite a formative period".
The Tory leader has submitted an 84-page witness statement and three exhibits to the inquiry and will be questioned about them in an all-day session.
Asked about his time in television before quitting for a political career, he said: "Carlton was quite a formative period.
"I formed a lot of views about the media then which I still hold today."
He said he also formed relations with many journalists at that time, though those with Westminster media were forged more in his previous role as a ministerial special adviser.
In that role, he said, he acted as both a "mouthpiece" for his home secretary and chancellor bosses and as a "sponge", meeting people the minister did not have time to see.
Asked if he ever gave his own opinions rather than representing those of the minister, he said: "On occasion, I am sure I would have made clear to people my own views about something."
Pressed on whether he would have made clear that he was not speaking the mind of his political boss, he replied: "I would hope so."
Cameron is expected to use his appearance to set out new regulations concerning special advisers as part of the ministerial code of interests.
Sir Robin Bogg
Culture Secretary Jeremy Hunt's aide Adam Smith was forced to resign after admitting that his contacts with News Corp representatives during the BSkyB takeover bid were too close.
It is likely that his examination will centre on issues such as the appointment of Andy Coulson as Downing Street spin chief and his friendship with Rebekah Brooks.
Coulson's and Brooks' appearances at the inquiry threw up a series of questions over Cameron's own actions both as opposition leader and after he entered 10 Downing Street in 2010.
The Prime Minister has conceded that he was guilty, just as his predecessors were, of getting too close to media proprietors and has called for relations to be "reset".
Details of a string of meetings with the media mogul and other senior figures before and after the 2010 election will be probed however.
Coulson, recruited by Cameron after resigning as News of the World editor over the initial phone hacking convictions in 2007, disclosed in his testimony that the PM did not press him for more details after July 2009, despite a stream of disclosures indicating the problem went deeper.
Meanwhile former News International boss Brooks laid bare the closeness of her friendship with the Tory politician - including his habit of signing off texts "lol" apparently in the belief it meant "lots of love".
He sent a message urging her to "keep your head up" when she too resigned over the phone hacking scandal and expressed regret that he could not be more loyal, she disclosed.
And she also set out a series of meetings with him following the election, including a Christmas dinner party at the Brooks' Oxfordshire home on December 23.
The prime minister is reported to have spent a significant amount of time preparing for his appearance before the inquiry.
The Daily Mail reports that Andrew Feldman, the Cameron's friend from university and the co-chairman of the Tory Party has been playing the role of Leveson QC Robert Jay in practise sessions.
Downing Street said Cameron had been receiving advice from a QC and the Treasury solicitor as he prepared to give evidence.