David Cameron has accepted the bulk of Labour's demands over the inquiry into the phone-hacking scandal.
The prime minister confirmed to MPs that the probe will be presided over by Lord Justice Leveson and held under the Inquiries Act 2005, meaning witnesses can be compelled to give evidence.
One part will investigate wrongdoing in the press and the police, after allegations emerged last week that journalists hacked into the phones of murder victims and fallen service personnel.
Another will cover a broader review of regulation in the press. This will assess journalists' relationship with the police, the current regulatory system and the contacts between national newspapers and politicians.
Mr Cameron proposed adding a section to the ministerial code requiring all Cabinet ministers to make public every meeting they have with media proprietors, senior editors and executives.
MPs expressed surprise when Mr Cameron announced that permanent secretaries and special advisers would also have to record these meetings.
He said he preferred a system of "independent regulation" rather than "self-regulation", making clear he did not want to see statutory regulation impinging on the freedom of the press.
"We all want the same thing: press, police and politicians that serve the public," Mr Cameron said.
"What this country – and this House - has to confront, is an episode that is frankly disgraceful."
The inquiry's terms of reference were discussed by Mr Cameron with Labour leader Ed Miliband and deputy prime minister Nick Clegg last night in the Commons.
Dowler family visit Downing Street
Mr Cameron spent the afternoon meeting the parents of murdered teenager Milly Dowler. Revelations about her phone being hacked into turned what had been a scandal about politicians and celebrities into something far more serious.
"At the start of this week the Dowler family wanted to have their voices listened to... on behalf of all the other ordinary victims of unlawful activity by the press," the family said in a statement.
"The Dowlers are delighted the prime minister has announced a full judge-led inquiry and they're particularly pleased that politicians for all three parties have liaised and reacted so quickly."
News International appeared to be struggling to contain its losses as politicians confronted the implications of the Dowlers' anger.
Deputy assistant commissioner Sue Akers, running the Metropolitan police's current investigation into phone-hacking, told MPs that up to 4,000 people were victims of phone-hacking.
Officers have only notified 170 victims that their phones were hacked into so far.