German Chancellor Angela Merkel attends a ceremony at the Chancellery in Berlin today. A broad swath of Germany's political class has condemned the US surveillance of Germans and EU offices, and some critics have questioned how much Mrs. Merkel knew about the American program.

Berlin — The US National Security Agency surveillance program PRISM was meant to provide intelligence related to terrorism and crime. But in Germany it has had an unintended side effect: It has become a factor in the campaign for September’s general elections.

Berlin’s political class is united in dismay over the revelations of large-scale US spying on Germany and other European countries and institutions. Officials across the political spectrum have wielded strong words to condemn the use of surveillance programs like PRISM and Tempora against Western allies of the United States, and the alleged bugging of European Union diplomatic offices.

The only voice that stayed conspicuously silent for days was that of Chancellor Angela Merkel.

“The reaction of the chancellor suggests she might have known about the spying,” wrote Sigmar Gabriel, chairman of the main opposition party, the center-left Social Democrats (SPD), in a commentary in Frankfurter Allgemeine Zeitung. The chancellery issued an angry denial. But when members of her cabinet voiced unease about the spying allegations, too, Mrs. Merkel realized she had to speak up.

"If it is confirmed that diplomatic representations of the European Union and individual European countries have been spied upon, we will clearly say that bugging friends is unacceptable," said Merkel's spokesman, Steffen Seibert, on Monday. "We are no longer in the cold war."

He added that Berlin felt surprised and "alienated" by the reports and had conveyed this to the White House. He said Merkel would soon speak to President Obama directly about the issue.

A heated topic

Privacy matters in Germany. Having lived through dictatorships that produced some of the world’s most notorious secret police forces like the Gestapo in Nazi Germany or the Stasi in the East Germany, Germans today react strongly against real or perceived violations of their private sphere.

For example, a few years ago, Google was taken by surprise when the introduction of their Street View map service in Germany caused a chorus of outrage. Thousands of people asked for the pictures of their homes to be blurred in the online service.

Industrial espionage is another issue for an economy that depends as heavily on exports as Germany's does.

“I think, particularly in the world of IT, we have made ourselves too dependent on US hardware and software,” says Oliver Grün, president and cybersecurity expert for IT Mittelstand, the German association of small- and medium-sized Internet companies. “This means we are vulnerable to interception. We need to come up with our own products.”

Political cost

For Merkel, it is the political cost that matters right now. Less than two weeks ago, she shared a stage with Mr. Obama at the Brandenburg Gate in Berlin, both emphasizing the strong bonds between Germany and the US. During that visit, Obama tried to dispel German concerns about the American spying program. A few days later, the German public learned that the program was of an even bigger scale and included bugging EU diplomatic offices.

“Either Merkel knew a lot more than she was letting on – or she knew nothing. Both cases would be a scandal,” says Thomas Oppermann, chief whip for the SPD in the German parliament, the Bundestag. Mr. Oppermann has called a meeting of the Bundestag Oversight Committee for Wednesday to look into Merkel’s handling of the affair and into why the German secret service, the BND, either did not detect the spying or knew about it and did not report it.

With Berlin's political class about to retire for the summer break, the opposition is trying to capitalize on the issue.

“They hope that PRISM and the whole surveillance affair will turn into Merkel’s Fukushima,” says Lorenz Maroldt, a political analyst and journalist with Berlin daily Der Tagesspiegel. “They hope it means the complete meltdown of her credibility.”

But so far, it is Obama who has lost credibility in Germany.

“Germans loved Obama. Now we don’t trust him” is the title of an op-ed in Sunday's New York Times by Malte Spitz, an Internet activist and member of the German Green party’s executive committee.

Mr. Spitz, like several other German politicians in recent days, quotes Benjamin Franklin: “They that can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety."