Britain's three main political parties agreed on Monday to create a new system to regulate the country's scandal-hungry newspapers, after a public inquiry exposed a culture of industrial-scale phone hacking and other unethical behaviour.
The deal, which is expected to pass through parliament later on Monday, will establish a new press regulator, introduce fines of up to £1 million ($1.5-million) and oblige newspapers to print prominent apologies where appropriate.
The system will be voluntary, but there will be strong financial incentives to encourage newspapers to opt into it.
"What we have today, which is a good thing, is a cross-party agreement," said a spokesman for Prime Minister David Cameron, saying the deal was struck in the early hours of Monday morning.
"It will put in place a strong system of independent regulation of the press."
The government came under pressure to create a new regulatory system after a judge-led inquiry and a series of arrests laid bare a disturbing culture of phone hacking and malpractice in some parts of the press.
The way that some tabloid newspapers reported the disappearance and death of two children attracted particular criticism.
But concerns that any deal would imperil press freedom delayed agreement, with some press barons threatening to boycott a new regulatory regime and campaigners for tougher regulation accusing Cameron of being in thrall to the press.
Monday's deal spares Cameron what was shaping up to be an embarrassing political defeat in parliament that would have deepened rifts in his coalition government.
The three parties had been divided over whether a new press regulator should be enshrined in law and over how its members would be chosen, but reached a compromise after agreeing to enact legislation to ensure the new system cannot be easily altered later.
Cameron said he was satisfied with the outcome.
"What we wanted to avoid, and what we have avoided, is a press law," he told BBC TV.
"Nowhere would it say what this body is, what it does, what it can't do, what the press can and can't do. That's quite rightly being kept out of parliament, so no statutory underpinning, but a safeguard that says politicians can't in future fiddle with this arrangement."
Ed Miliband, the leader of the opposition Labour party, also said the compromise struck the right balance.
"I genuinely believe it upholds the freedom of the press and also meets the terms that the victims (of phone hacking) have set out," he said, adding that investigative journalism would not be restricted by the new arrangement.
"People who reveal MPs' expenses and phone hacking have nothing to fear from what has been agreed."
Others were less happy.
Index on Censorship, a group that campaigns for free speech, said it was a "sad day for press freedom in the UK".
"The involvement of politicians undermines the fundamental principle that the press holds politicians to account," said Kirsty Hughes, its CEO.
"Politicians have now stepped in as ringmaster and our democracy is tarnished as a result."
Hacked Off, a group representing the victims of newspaper behaviour, welcomed the agreement, saying it did enough to protect the public from press abuses.
Separately on Monday, in the latest round of civil claims brought by the victims, a member of parliament accepted "very substantial" damages from Rupert Murdoch's The Sun newspaper after its employees accessed her stolen mobile phone.
Cameron ordered the inquiry into newspapers' behaviour after Murdoch's now-defunct News of the World admitted widespread hacking into phone messages to generate salacious stories.
Police investigating the scandal arrested four current and former journalists from the rival Mirror Group Newspaper (MGN) group last week. Tens of people from Murdoch's British tabloids have been arrested for hacking voice messages and for conspiring to make payments to public officials.
The examination of media tactics revealed the close relationships between Britain's media bosses and Cameron, embarrassing the prime minister by publishing friendly text messages that called his judgment into question.
Cameron's spokesman said all three party leaders would hold a phone call later on Monday to confirm what had been agreed and that the prime minister would address parliament on the subject.