But in the eyes of a skeptical, privacy-minded German public, at least, Der Spiegel’s report may have undercut the significance of the proposed accord by noting that the eavesdropping described in the Snowden documents would have violated agreements that the United States has made.

The report said that the N.S.A. succeeded last year in cracking an encrypted video teleconferencing system at the United Nations, and even stumbled across Chinese spies who were apparently invading the same communications system. The magazine also published a floor plan, evidently from N.S.A. files, of the third floor of the European mission to the United Nations on Third Avenue in New York, showing the locations of offices and computer servers. Der Spiegel suggested that the spying on allies and the United Nations made President Obama’s defense of surveillance programs as a counterterrorism effort seem misleading at best.

For the German government, the whole affair is frustrating. One senior official who spoke on the condition of anonymity argued that Ms. Merkel had generally done a good job of keeping foreign affairs and controversy out of domestic politics, only to have Mr. Snowden’s revelations capture world attention just as she was preparing to receive Mr. Obama in Berlin in June, depart on vacation in July and open the final stage of her election campaign in August.

With Mr. Obama at her side on June 19, Ms. Merkel, who is said by several well-informed people to have very much wanted the president to come to Berlin before the election, kept the emphasis on cooperation. She cited a well-known instance in which a tip from American intelligence helped thwart a potential terrorist attack in Germany.

By early July, however, United States-German ties were under strain once more, after Der Spiegel, citing documents obtained through Mr. Snowden, reported that American intelligence agencies regularly examined huge volumes of digital information traveling in and out of Germany.

Exasperated officials on both sides lamented privately that security restrictions kept them from being able to offer more details to back up general reassurances that the German public was not under sweeping surveillance by the United States.

Ms. Merkel sent at least two high-level delegations to Washington to press for the new accord. It seems that prompted Mr. Obama to say at his Aug. 9 news conference “to others around the world” that he wanted “to make clear once again that America is not interested in spying on ordinary people.”