David Cameron admitted today that the decision to employ former News of the World editor Andy Coulson had "haunted" him.
The Prime Minister told the inquiry he knew making Coulson his director of communications was a "controversial appointment".
But he insisted that he had sought assurances from the former editor that he had no knowledge of phone-hacking practices at the now-defunct newspaper.
Cameron said: "Why did I feel he deserved a second chance? Because I though that he had done the honourable thing. Something very bad had happened on the newspaper he was editing. He did not know and he resigned."
Coulson had also given the same assurances to the police, Press Complaints Commission and the Culture, Media and Sport Select Committee at various stages, which had all "accepted his word", Mr Cameron added.
He said: "I just make one point, because I recognise this is a controversial appointment. This has come back to haunt both him and me, but in doing the job of director of communication for the party and in Downing Street he did the job very effectively."
Cameron told the inquiry he believed he sought assurances from Coulson over phone hacking during a face-to-face meeting in his parliamentary office in March 2007.
"I knew it was very important that I needed to ask him that question, therefore did so."
Coulson suggested in evidence that he was asked about the matter in a phone call at a later date.
Cameron said: "The key thing is, I asked for assurances. I got them and on that basis I employed him."
He added in a written statement to the inquiry: "He denied any knowledge of the hacking but said he took responsibility for what had happened on his watch.
"I asked him specifically about his involvement.
"My question was always whether any new evidence had been disclosed to suggest any knowledge of hacking.
"If such evidence had been revealed, I would not have employed him."
Cameron said Coulson had come up with the "most destructive" headline anyone ever had written about him, adding: "Three words, hug a hoodie." This was a reference to coverage of a speech he gave calling for more understanding about why young people became involved in crime.
Coulson resigned as editor of the News of the World in January 2007 after the paper's former royal editor Clive Goodman and private investigator Glenn Mulcaire were jailed for phone hacking.
In May 2007, Coulson was named as the Conservative Party's director of communications and planning - three years before Cameron became Prime Minister in May 2010.
In January last year he resigned as Downing Street communications chief, saying the News of the World phone-hacking row had been making his job impossible.
Cameron said he had been looking for a "big hitter" who could cope with the intense pressure of the job of handling media strategy for a major political party.
The inquiry was told that over a weekend that could involve anything from policy issues, a scandal around an MP's expenses or a marriage breakdown.
"It literally comes down on top of your head. It's very fast and furious and you need someone seriously good at handling that."
The Prime Minister said he had talked to four other potential candidates about the position. One was Guto Harri, a former BBC employee who helped Boris Johnson in his mayoral election campaigning.
He refused to name the others but said the list included "someone senior from a broadsheet" as well another senior BBC employee and a tabloid journalist.
Cameron agreed that Liberal Democrat leader Nick Clegg had concerns about Mr Coulson's role after the coalition Government was formed in 2010.
"I don't remember them being particularly strong," said Cameron. "As far as I recall it was 'There's been controversy about this. Are we sure he's the right man for the job?' I don't remember the conversation in any great detail."
Cameron added: "It may have been no more than wanting to ensure that people were, as it were, coalition-friendly."
He told the inquiry: "This was a controversial appointment... Clearly some people did have concerns."
'We're all in this together'
Elsewhere in the inquiry, it emerged that Rebekah Brooks sent a text message to Cameron telling him "professionally we are all in this together".
In the message from the former News International chief executive - among a batch the inquiry ordered News International to hand over - she also said she was "rooting for him" ahead of a major speech.
The text was read out by the inquiry's counsel Robert Jay QC as he questioned Cameron about his close friendship with former Sun editor Mrs Brooks.
The message, sent on the eve of Mr Cameron's speech to the Conservative Party conference in 2009, and just days after The Sun switched its support to his party from Labour, it said: "I'm so rooting for you tomorrow not just as a proud friend but because professionally we are in this together. Speech of your life? Yes he Cam!"
Asked to explain the message, Cameron said: "The Sun had made this decision to back the Conservatives, to part company with Labour.
"The Sun wanted to make sure it was helping the Conservative Party put its best foot forward with the policies we were announcing, the speech I was making. That's what that means."
He went on: "We were friends. But professionally, me as leader of the Conservative Party, her in newspapers, we were going to be pushing the same political agenda."
The text also showed something of the personal relationship the pair enjoyed, with Brooks saying: "But seriously, I understand the issue with The Times. Let's discuss over country supper soon.".
She also talked about Cameron's failure to attend a conference party thrown by NI - for which he told the inquiry the message was a reply to his apology.
"On the party it was because I had asked a number of NI people to Manchester post endorsement and they were disappointed not to see you," she wrote.
Referring to his wife, she went on: "But as always Sam was wonderful (and I thought it was OEs that were charm personified)."
It is suggested that the abbreviation refers to Old Etonians. Cameron and Brooks's racehorse trainer husband Charlie were pupils at the elite public school together.
Jay said the text message had been supplied as the result of a request to NI requiring the disclosure of material.
In her own evidence, Brooks said she had been able to access only a limited number of her personal communications after resigning over the phone-hacking inquiry.
Jay said it was one of a batch from October 2009 to May 2011 but it was the only one relevant to the line of questioning.
It was partly redacted, apparently removing a personal part of the text at the start.
Cameron repeatedly said during the course of an extended grilling over his close personal ties to Mrs Brooks that he could not be certain how frequently they met or spoke by telephone.
"I do not think every weekend, I do not think most weekends. But it would depend," he said.
The frequency rose after she began seeing Mr Brooks and moved into his home, becoming a near neighbour of the Camerons in Oxfordshire.
Nor was he able to say even approximately at what point he believed she had become sympathetic to his party's cause, though he accepted it was more than weeks before the formal announcement of the Sun's support.
After a lunch break, Cameron told the inquiry: "I gave a rather vague answer about the issue of social contact between myself, my wife and Rebekah and Charlie Brooks.
"Mrs Cameron keeps a rather better weekend diary than I do."
He said his wife's diary suggested the Camerons were "in the constituency" on 23 weekends in 2009 and 15 in 2010.
Cameron added: "We probably did not see them more than once every six weeks."
Lord Justice Leveson said: "The great value of wives, Prime Minister."
Press regulation isn't working
Cameron also claimed that an independent system is needed to fix Britain's broken method of press regulation.
The Prime Minister told the inquiry that the relationship between the press and politicians had been too close for 20 years.
He admitted that it was difficult for governments to reform the system because they had a vested interest.
"We need to try to find a way for some independence to be brought to that," he said. "I think the regulatory system we have at the moment doesn't work.
"We need to draw some boundaries but it is very difficult to do.
"If you take the expenses scandal, it was deeply painful for politicians but it was absolutely right that it was revealed."
He added: "In the last 20 years, I think the relationship has not been right. I think it has been too close and I think we need to get it on a better footing."
Cameron told the inquiry that the advent of 24-hour news channels had made life more difficult for governments.
He said: "We are in a permanent battle of issues being thrown at you hour by hour where responses are demanded incredibly quickly.
"Politicians have to get out of the 24-hour news cycle to try to fight every hourly battle and face long-term issues and be prepared sometimes to take a hit on a story."
Cameron said the relationship with the press was "not particularly trusting at the moment".
"I think a lot of politicians think the press always get it wrong," he said. "A lot of the press think politicians are in it for themselves - are not in it for the right reasons. It's become a bad relationship.
"The expenses scandal was a massive knock to Parliament and politicians' standing and politicians have to prove they are worthy of respect."
Cameron was asked about meetings with newspapers.
He suggested that he targeted Conservative-supporting newspapers and added: "With all due respect to the Daily Mirror, there is only a certain amount of impact I am going to have."
Cameron said broadcasting rules meant that television "could not be on your side".
He added: "A lot of the time when I was party leader was spent thinking how you could get your message our message across on television."
'A cathartic moment'
Cameron told the inquiry: "This is, I think, a cathartic moment, when ... all the relationships that have not been right, we have a chance to reset them, and that is what we must do."
The Prime Minister said in his written evidence that he had "never traded or offered a position on policy in return for the support of any media outlet".
He pointed to "quite strong disagreements" he had with Rupert Murdoch over the BBC or the Daily Telegraph over planning laws as evidence of his independence.
He also defended his personal closeness to senior media figures.
"You have to take care when you have personal friendships. But I think that can be done and I like to think I've done that," he told the inquiry.
Cameron said that while he accepted the need for media plurality rules, he felt it was the nature of individual titles that in large part determined their influence, not the size of the stable they were from.
"It is not necessarily the size of the newspaper group, it is the strength and the voice of the paper," he said, singling out the Daily Mail as an example.
It was "an incredibly powerful force in the nation's politics but that was "not related really to its market power, it is to do with the way it pushes its agenda".
He complained about sustained campaigns against politicians and policies saying that the "volume knob had has been turned up really high in our press".
"Sometimes that does no one any favours."
Fact and comment
But he also suggested that political leaders were far more concerned about the evening television news bulletins than they were about newspaper headlines.
He said part of the blame for hacking and other issues getting out of control was the reluctance of the political class to step back from its ties with the media.
"The press want access, the politicians want coverage for what they are doing, so the two parts focus on that.
"When it was going wrong, what did not happen was the politicians and the press did not disengage and say 'we have a real problem here and we need to deal with this'."
On the question of whether it was possible to force a separation of fact and comment in newspapers, he was firm that it was a "forlorn hope" and not one that should be pursued.
"It's quite impractical," he said