The Attorney General Dominic Grieve last night warned news organisations that they will face prosecution if they publish material which could prejudice court proceedings.
His warnings following a series of prosecutions over the last year over breaches of the 1981 Contempt of Court Act by newspapers.
The press has shown an increasing tendency to test the boundaries of what was acceptable in reporting criminal cases, Grieve said in a speech at City University School of Journalism in London.
"At times it appeared to me the press had lost any sense of internal constraint and felt able, indeed entitled, to print what they wished, shielded by the right of 'freedom of expression' without any of the concomitant responsibilities," he said.
The provision in the Criminal Justice Act 2003 which allowed a defendant's previous convictions to be given in evidence at a trial had exacerbated the trend, leading "some in the press to believe they can print, without let or hindrance, all manner of true facts, abuse and nonsense,"Grieve said.
He added that it was essential jurors were "not contaminated by material which has not been presented to them as evidence".
Grieve detailed three cases in which he had successfully taken action for contempt of court.
In the first case the Sun and Daily Mail both published pictures of the defendant in a murder trial carrying a gun on the their websites. Each paper was fined £15,000 plus costs of £28,117.
In the second, the Daily Mirror and Sun were fined over their coverage of the arrest of Chris Jefferies, the landlord of murdered landscape architect Joanna Yeates, with the court ruling that articles published by both papers would have been extremely damaging to Jefferies and his defence.
"This reinforced the message that proceedings are active from the time of arrest. Caution, not to say common sense, must therefore come into play when reporting on a case involving an arrested suspect – a suspect who may never be charged," Grieve said.
He added: "Although not a legal consideration, I would suggest there is a moral imperative in all of this – the need go observe common decency when reporting on such cases."
A third case, in which a juror at a trial was jailed for eight months after contacting one of the defendants in the case via Facebook also highlighted the point that "the internet does not provide some form of immunity from prosecution".
Grieve said he had endeavoured to work constructively with the press. He wanted to build a measure of consensus for the future, and had met the press at sessions at the BBC and the Press Complaints Commission.
"One of the points which I have taken away from these meetings is that the press would welcome more advisory notices," he said.
"From time to time, when media reports are clearly becoming overheated and risk straying into the territory of contempt, I will issue a warning to the press about their reporting.
"These are called advisory notices, and highlight potential problems with press coverage of a case or incident. They are not for publication and are circulated to the legal departments of major press organisations.
"In recent years it has been the practice only to issue an advisory in the most extreme of cases – I did so in the case of Mr Jefferies and have done so in other recent cases and often the effect seems to have been helpful."
But he warned that it would be dangerous for the media to conclude that a failure to issue an advisory notice in a case meant that "it is open season".
"Absent an advisory, when deciding if something risks being deemed contemptuous, I would suggest looking carefully at what the law says, the cases previously described and applying some common sense principles of fairness.
"Indeed, at the pre-charge stage, before any decision has been made as to sufficiency of evidence, there is much to be said for the formula – in common currency when I was a boy – that a man is 'helping police with their inquiries'.
"So doing, avoids providing unnecessary detail which, potentially, leads to the vilification of someone later shown to be wholly innocent – Mr Jefferies springs to mind."