Mr Justice Saunders said he was "very concerned" about the comments the Prime Minister made after Coulson was found guilty of plotting to hack phones at the News of the World but while verdicts were pending on other charges.
Yesterday, Mr Cameron led the way in what the judge described as "open season" by immediately offering a public apology for hiring Coulson in 2007.
At the time, the jury was still deliberating on two remaining counts against Coulson, 46, of allegedly conspiring with former royal editor Clive Goodman, 56, to commit misconduct in a public office in relation to paying police officers for two royal phone directories.
Jurors have now been discharged, not because of prejudicial comments but because they failed to reach verdicts on the final charges after nine days deliberation.
Coulson now faces up to two years in prison when he is sentenced next week. His ex-lover and colleague Rebekah Brooks was cleared of all charges yesterday. A decision will be made on Monday whether to order a re-trial for Coulson and Goodman.
This morning, despite claims of the Prime Minister's "ill-advised and premature intervention" in the case, the judge put his trust in jurors to ignore him and dismissed a bid to discharge.
He said he asked the Prime Minister for an explanation and was told by his principal private secretary: 'The Prime Minister was responding to the guilty verdict on hacking charges that had been delivered in open court. He did this in the light of the intense media coverage and understandable public interest. The Prime Minister was careful to make no further comment about any matters that might still be before the court.'
But the judge said the Prime Minister had "missed the point" and revealed information the jury had not been told during the trial for legal reasons.
He said: "My sole concern is to ensure that justice is done. Politicians have other imperatives and I understand that. Whether the political imperative was such that statements could not await all the verdicts, I leave to others to judge."
The jury were "deep in an analytical discussion" on the evidence and they should be allowed to continue, he said: "We underrate juries, and particularly this one, at our peril."
The judge went on: "I'm satisfied the jury should not be discharged as I am satisfied they will continue to try Mr Coulson and Mr Goodman on the evidence that they have heard in court and solely on that evidence.That does not mean that I am not concerned about what has happened in this case.
"The press in court have been extremely responsible in their reporting of this case but when politicians regard it as open season, one cannot expect the press to remain silent. I accept that this case is very unusual if not unique, but the situation could occur again and I would urge that discussions take place to try and set up a better system of dealing with it."
Earlier today, Coulson's lawyer blamed David Cameron, George Osborne and Ed Miliband for putting politics before justice and ignoring the directions of the judge to exercise restraint.
Timothy Langdale QC said: "This was an extraordinary situation where the ill advised and premature intervention by the Prime Minister and others to avoid political damage or make political capital is almost impossible for the jury to ignore. It strikes at the heart of justice."
"It is astonishing, we say unprecedented, for a prime minister to make public comments of such a crucial juncture in trial proceeding."
"There has been the inevitable maelstrom of reporting across all forms of media...both nationally and internationally."
Prejudicial comments came from the highest levels from public life, he said.
"The jury has been exposed to material which was not in evidence which is highly prejudicial to Mr Coulson - that Mr Coulson lied to the Prime Minister, parliament and the public. It directly impacts on Mr Coulson's credibility that goes significantly beyond the verdict on count one."
He said the comments came from "entrenched party political battles" with no regard for the laws on prejudicing a jury.
But prosecutor Andrew Edis QC said: "What Mr Cameron said is Mr Coulson told him a lie. What Mr Miliband said is Mr Coulson is a criminal. The jury were satisfied so they were sure Mr Coulson was guilty of count one which makes him to that extent a criminal. In coming to that conclusion they decided he had told them lies for days on end about phone hacking so Mr Cameron was not really telling them anything that they did not know."
"This is probably the most media savvy jury that has ever tried a criminal case. They have seen the underside of the press. They have heard evidence about relationships between the press and politicians. They know what goes on better than anyone and they are very well placed indeed to discount media comment and to concentrate on the evidence they have heard."
Following the partial verdict yesterday, Mr Cameron said: "I take full responsibility for employing Andy Coulson. I did so on the basis of undertakings I was given by him about phone hacking and those turned out not to be the case.
"I always said that if they turned out to be wrong, I would make a full and frank apology and I do that today. I am extremely sorry that I employed him. It was the wrong decision and I am very clear about that."
Mr Osborne said: "We gave him a second chance but, knowing what we now know, it's clear that we made the wrong decision."
And Shadow chancellor Ed Balls told BBC Radio 4's Today: "The question for the Prime Minister is: is a partial apology enough or do we have to look into what went wrong?"
Coulson was recruited by Chancellor George Osborne to head the Tory media operation within months of resigning as News of the World (NotW) editor in January 2007 because hacking happened on his watch.
When Mr Cameron entered Downing Street, he took on duties heading the No 10 spin operation, quitting shortly before he was arrested when the phone-hacking scandal erupted again four years later.
As he left court today, Goodman, 56, of Addlestone, Surrey, said he did not want to make a comment. Aside from Coulson, 46, of Charing, Kent, all the other defendants in the case were acquitted by the jury yesterday.
The hacking trial is not the first time Mr Cameron has fallen foul of an English court for making comments connected to an ongoing trial.
Last year the Prime Minister was criticised by a judge for publicly backing Nigella Lawson during the fraud trial of her personal assistants Elisabetta and Francesca Grillo.
Judge Robin Johnson had to warn jurors to ignore Mr Cameron's comments in an interview in the Spectator, in which he said he was for "team Nigella" and was a "massive fan" of the celebrity cook.
Downing Street said Mr Cameron had taken "the best legal advice" before making his televised statement yesterday, but declined to say whether the advice had come from Attorney General Dominic Grieve.
A senior source at Number 10 had no immediate response from the PM to the judge's comments, as the discharge of the jury came while he was on his feet in the House of Commons taking questions and he had not yet had a chance to consider it.
The source added: "The Prime Minister has no criticism of the judge's actions."
Labour said Mr Miliband had been careful in his own televised statement not to raise issues of Coulson's character or the facts of the trial - other than to refer to the former Number 10 director of communications as a "criminal", a fact which had been established by the jury itself.
"It seems to us that these are matters between the judge and the Prime Minister," said a senior Labour source.
"We certainly took advice. We listened to what the judge said about behaving in a responsible manner. We were reacting to the Prime Minister's statement. We were responsible in our reaction to the Prime Minister's statement. We were clear that these were questions about the behaviour of the Prime Minister and his actions in bringing a criminal into the heart of Downing Street.
"We didn't comment on the character of Andy Coulson or the trial. We merely made reference to the fact that he was a criminal, which was an established fact."