German outrage over a U.S. Internet spying programme has broken out ahead of a visit by Barack Obama, with ministers demanding the president provide a full explanation when he lands in Berlin next week and one official likening the tactics to those of the East German Stasi.

German Chancellor Angela Merkel's spokesman has said she will raise the issue with Obama in talks next Wednesday, potentially casting a cloud over a visit that was designed to celebrate U.S.-German ties on the 50th anniversary John F. Kennedy's famous "Ich bin ein Berliner" speech.

Government surveillance is an extremely sensitive topic in Germany, where memories of the dreaded Stasi secret police and its extensive network of informants are still fresh in the minds of many citizens.

In a guest editorial for Spiegel Online on Tuesday, Justice Minister Sabine Leutheusser-Schnarrenberger said reports that the United States could access and track virtually all forms of Internet communication were "deeply disconcerting" and potentially dangerous.

"The more a society monitors, controls and observes its citizens, the less free it is," she said.

"The suspicion of excessive surveillance of communication is so alarming that it cannot be ignored. For that reason, openness and clarification by the U.S. administration itself is paramount at this point. All facts must be put on the table."

Markus Ferber, a member of Merkel's Bavarian sister party who sits in the European Parliament, went further, accusing Washington of using "American-style Stasi methods".

"I thought this era had ended when the DDR fell," he said, using the German initials for the failed German Democratic Republic.

Opposition parties have jumped on the issue, keen to put a dampener on the Merkel-Obama talks and prevent them from boosting the chancellor as she gears up for a September parliamentary election in which she is seeking a third term.

"This looks to me like it could become one of the biggest data privacy scandals ever," Greens leader Renate Kuenast told Reuters.

Obama is due to land in Berlin on Tuesday night, hold talks and a news conference with Merkel on Wednesday and then give a speech in front of thousands at the Brandenburg Gate.

It is his first trip to the German capital since he passed through in 2008 during his first campaign for the presidency, giving a speech at the Victory Column in the Tiergarten park that attracted 200,000 adoring fans.

Five years on, Germans are still enamoured of Obama: a poll last week showed 82 percent view him favourably.

But his failure to close the Guantanamo Bay military prison, extensive use of drones to kill suspected al Qaeda militants and the latest revelations about the secret surveillance programme, codenamed PRISM, have tempered enthusiasm.

According to documents leaked to the Washington Post and Guardian newspapers, the programme gave U.S. officials access to emails, web chats and other communications from companies like Google, Facebook, Twitter and Skype.

Obama has defended it as a "modest encroachment" on privacy and reassured Americans that no one is listening to their phone calls.

But U.S. law puts virtually no eavesdropping restrictions on the communications of foreigners, meaning in theory that Washington could be delving into the private Internet communications of Germans and other Europeans.

Peter Schaar, the German official with responsibility for data privacy, said this was grounds for "massive concern" in Europe.

"The problem is that we Europeans are not protected from what appears to be a very comprehensive surveillance programme," he told the Handelsblatt newspaper. "Neither European nor German rules apply here, and American laws only protect Americans."