BERLIN — Germany’s federal prosecutor announced Wednesday that he had begun a formal investigation of what he called “unknown” members of American intelligence agencies on suspicion that they had eavesdropped on one of Chancellor Angela Merkel’s cellphones.

Anger at the National Security Agency and the British intelligence services has simmered and occasionally erupted full force since the magazine Der Spiegel and other Western news media outlets published material last June from Edward J. Snowden, the former N.S.A. contractor, suggesting that millions of Germans’ data and phone calls had been monitored.

By October, Der Spiegel uncovered evidence that Ms. Merkel’s cellphone was among those tapped. The German government, stung by the behavior of its most powerful ally, angrily demanded an explanation. The White House swiftly assured the chancellor that she is not and will not be under that kind of surveillance, but pointedly omitted saying anything about the past.

Public anger and political pressure have only increased since. American and German officials have failed to find a way to reconcile their need to combat terrorism with the Berlin government’s demand that secret services observe German law — which is strict on privacy matters — when operating in Germany.