The Metropolitan police has dropped its attempt to force the Guardian to reveal confidential sources for stories relating to the phone-hacking scandal.

Scotland Yard wanted a court order to force Guardian reporters to reveal confidential sources for articles disclosing that the murdered teenager Milly Dowler's phone was hacked on behalf of the News of the World. They claimed that the paper's reporter Amelia Hill could have "incited" a source to break the Official Secrets Act.

A police spokesman said: "The Metropolitan Police's Directorate of Professional Standards consulted the Crown Prosecution Service (CPS) about the alleged leaking of information by a police officer from Operation Weeting.

"The CPS has today asked that more information be provided to its lawyers and for appropriate time to consider the matter.

"In addition the MPS has taken further legal advice this afternoon and as a result has decided not to pursue, at this time, the application for production orders scheduled for hearing on Friday 23 September. We have agreed with the CPS that we will work jointly with them in considering the next steps."

The Met's attempt to identify potential police leaks was widely condemned.

The statement put out by the Met announcing its retreat left open the possibility that the production order could be applied for again, but a senior Yard source said: "It's off the agenda. There will be some hard reflection. This was a decision made in good faith, but with no appreciation for the wider consequences.

"Obviously the last thing we want to do is to get into a big fight with the media. We do not want to interfere with journalists.

"In hindsight the view is that certain things that should have been done, were not done, and that is regrettable."

The Guardian's editor-in-chief, Alan Rusbridger, said: "We greatly welcome the Met's decision to withdraw this ill-judged order. Threatening reporters with the Official Secrets Act was a sinister new device to get round the protection of journalists' confidential sources.

"We would have fought this assault on public interest journalism all the way. We're happy that good sense has prevailed."

The Met applied for production orders as part of Operation Weeting, its investigation into phone hacking.

An officer working on the operation was arrested last month on suspicion of misconduct in public office relating to the unauthorised disclosure of information. He has been suspended from the force and is on bail.

Scotland Yard said the investigation into the alleged leaks had not concluded and stressed their investigation was "about establishing whether a police officer has leaked information, and gathering any evidence that proves or disproves that".

The Met added: "Despite recent media reports, there was no intention to target journalists or disregard journalists' obligations to protect their sources.

"It is not acceptable for police officers to leak information about any investigation, let alone one as sensitive and high profile as Operation Weeting."

The force said the application for production orders had been made under the Police and Criminal Evidence Act rather than the Official Secrets Act.

Senior Scotland Yard sources said the force "regretted" the attempt to get the Guardian to hand over its notes and reveal sources.

The picture painted by the Metropolitan police is that a relatively junior officer took the decision, without consulting his superiors, setting off a calamitous chain of events that saw the force roundly condemned for an attempted assault on press freedom.

Sources said that the senior investigating officer (SIO) who was inquiring into whether a member of the Weeting team had leaked information, had on his own, taken the decision to seek the production order.

The senior source said that even Deputy Assistant Commissioner Mark Simmons had not been told about the decision in advance. Simmons is the head of professionalism issues at Scotland Yard and is seen as a rising star within the force.

The senior source said: "There was not a lot of happy people at our place over the weekend because it was a decision made by the SIO. There was no referral upwards, and you would have thought on something as sensitive as this there would have been."

The decision for the Met to end its attempt to get the Guardian to hand over its notes and reveal sources, said the source, came after the force finally consulted the CPS and consulted again with its own lawyers.

Simmons and the force's incoming commissioner, Bernard Hogan-Howe, did discuss the issue, as the chorus of criticism grew, but the source said the commissioner had left it to Simmons to take the decision, and that there was no instruction or directive.

The Met stressed that Hogan-Howe, despite as deputy commissioner being in charge of professional standards, was not involved in the original decision to seek a production order, and that Simmons had taken the decision, after the firestorm of criticism to review the application by the SIO.