An independent regulator which has "real teeth" is needed to fix the broken system of British press regulation and will be judged successful only if it can stop a repeat of the painful experiences suffered by the families of murdered teenager Milly Dowler and missing toddler Madeleine McCann, David Cameron has said.

The prime minister told the Leveson inquiry into press ethics that the Press Complaints Commission had failed and the future regulator had to be independent of the press.

"It can't be self-regulation, it has to be independent regulation," he said adding that the new regulatory framework needed to punish newspapers who were persistently breaching the rules.

"Where mistakes are made and bad practice happens there are real penalties as a result," he said.

"It must be independent – and seen to be independent, you can't opt out of it. It has to have real teeth in terms of penalties and the ability to get out and find out what happened rather than just deal with self-reported problems," he said addressing criticism that the PCC did not actively investigate allegations of phone hacking at the News of the World and merely accepted News International's word that it was not widespread.

The PCC, which has been running for 21 years, is being wound down, and proposals for a replacement regulator have been submitted to the Leveson inquiry by Lord Hunt, the former Tory minister who was appointed to move the PCC into the new regulatory system.

"I've looked carefully at what David Hunt is suggesting. I think he has some very good ideas there.

"I think they have to be rigorously tested as to whether they can deliver independence, penalties, compulsion, toughness, public confidence and all the rest of it," Cameron told the inquiry.

The cases of the Dowlers and the McCanns, who accepted £550,000 from Express newspapers in 2008 for defamatory articles, was a "powerful" reminder of the failures of the existing system.

"I will never forget meeting the Dowler family in Downing Street to run through the terms of this inquiry with them and to hear what they had been through and how it had redoubled, trebled the pain and agony they'd been through over losing Milly. I'll never forget that, and that's the test of all this," he said.

He said the new system was not there to make politicians or the press feel happy but to protect innocent people like the McCanns and Dowlers "who have been caught up and absolutely thrown to the wolves".

The prime minister stressed that the new body should prioritise achieving swift justice for ordinary people rather than protecting the rich and famous.

Lord Justice Leveson admitted that asking Cameron for his views on press regulation might be out of line given that the prime minister had asked him to come up with recommendations in the first place.

Cameron duly sat on the fence over the issue of whether the future body should be backed up by new laws, something critics have warned could be a slippery slope to government controls over the press.

But the prime minister hinted that he may favour a robust form of self-regulation as long as it passed the "Dowler" test when Leveson reports back in October.

He said his former incarnation as a head of communications for an ITV company, the now defunct Carlton Communications, gave him first hand experience of "full-on statutory regulation" requiring impartiality and balance and this wasn't necessary for newspapers.

"If we can make a self-regulatory system work that is genuinely independent and the "self" sort of disappears, that would be fantastic, but what matters is the outcome rather than the title, as it were," he said.