Prosecutor Andrew Edis QC told the Old Bailey that private investigator Glenn Mulcaire hacked the 13-year-old's phone for the newspaper as her parents sought news of their missing daughter.
Former editor Rebekah Brooks, her then deputy Andy Coulson and former managing editor Stuart Kuttner were criminally involved in the phone-hacking conspiracy, Mr Edis told their trial.
Describing what the Dowlers were experiencing, he said: "It is obvious [Milly's] family … would have been in an agony of hope that they might find her."
Milly disappeared on March 21 2002; her body was not found until November that year.
The revelation the Sunday paper had hacked the schoolgirl's phone led to the closure of the News of the World in 2011.
Mr Edis said Mr Kuttner even went to Surrey Police, which was investigating Milly's disappearance, to tell detectives the newspaper had a voicemail tape which could assist with the inquiry.
"It is good that they gave that information to the police," Mr Edis said. "What is less good is they gave the information to the police on Saturday, when they had had it for several days."
He told the jury it was possible the force "could and should have investigated" the information at the time, but officers would have been focused on finding the missing teenager. Mr Edis went on to claim Ms Brooks took a particularly interest in the Dowler story because of her previous involvement in a similar case, that of murdered schoolgirl Sarah Payne.
The trial also heard Mr Coulson, who became editor of the News of the World before becoming David Cameron's spin doctor, confronted former home secretary David Blunkett over an affair he was having with a married woman.
Mr Coulson told Mr Blunkett in August 2004 he had discovered his affair with Kimberly Quinn from "extremely reliable sources".
Mr Edis said this information came after the newspaper hacked Ms Quinn's phone. He told jurors Mr Blunkett recorded the meeting with Mr Coulson on August 13, during which the editor advised him the newspaper was planning to publish a story about his relationship with Ms Quinn.
In the recording, Mr Coulson told Mr Blunkett: "There's no desire at all to cause you damage, politically or otherwise. We would not want to see anything published that would cause you damage."
Mr Blunkett, who was not married at the time, replied: "A private life is private. If you don't have a private life we don't have anything."
In the recording, Mr Coulson told Mr Blunkett he was confident in the information, which proved the politician had had a three-year affair, and told him: "My job is to sort out the nonsense from the accurate. I believe if I don't do this story at least one of my sources will take this information to another newspaper."
But when asked about the information upon which the story was based, he said: "It is based on extremely reliable sources," adding: "I am not able to lay out clear-cut evidence but I believe it to be true. All I would ask is that you look at what I have done here and perhaps accept the information I have got is pretty solid. I would not be exposing myself in this way unless I believed the story to be true."
The court heard that an article about Mr Blunkett's affair with a married woman, who was not named in the initial story, was published on August 15.
Recordings of voicemails on Ms Quinn's phone revealed the affair, the court heard. The recordings included a message from a clinic telling her she was due to come in for a scan, indicating she was pregnant, the court heard.
Mr Edis told the jury: "We say it is inconceivable a newspaper would publish a story of that kind about a serving Cabinet minister without knowing it was true.
"Mr Coulson did know it was true … because of the voicemails which had been obtained as a result of tasking Glenn Mulcaire, who by August 2004 had been working regularly for the News of the World for four years …
"We say to you that's very strong evidence against Mr Coulson of involvement in phone hacking at the News of the World."
Ms Brooks, 45, of Churchill, Oxfordshire; Mr Coulson, also 45, from Charing in Kent; and Mr Kuttner, 73, from Woodford Green, Essex, all deny conspiring with others to hack phones between October 3, 2000 and August 9, 2006. Mulcaire has already admitted phone hacking.
The trial continues.