In 1955, just a decade after the end of World War II, the young Federal Republic of Germany received the status of a sovereign state through the General Treaty with the US, the UK and France. At the same time, the German government also granted the Allied forces various special rights.
According to the findings of historian Josef Foschepoth, the government of the day allowed extensive secret service operations on German territory and agreed to the surveillance of the West German postal and telecommunications services.
"These arrangements are still valid today and binding for every successive German government," Foschepoth told DW in an interview.
In other words, as the historian points out, it's possible that even the tapping of German Chancellor Angela Merkel's mobile phone had some sort of legal basis. Although the treaty documents do not explicitly allow the US secret service to spy on the German government, they do not explicitly forbid it, either.
In the treaty, German Chancellor Konrad Adenauer granted the Allies certain rights that prevailed over the confidentiality laws pertaining to mail and telecommunications as stipulated in the German Basic Law. "This is how the big German-Allied intelligence service complex came into being," said Foschepoth.
After all, as he pointed out, it was West Germany - the "frontier state" of the Cold War - that allowed the NSA to flourish. Even today, the NSA still has branches in the country: in Wiesbaden, for example.
How long do special rights remain valid?
But whether these past arrangements constitute a valid basis for the current activities of US intelligence services in Germany is disputed. Nikolaos Gazeas, an expert on international law at the University of Cologne, is impressed with Foschepoth's research but does not agree with his conclusions.
"Even if one assumes that the Allies were granted these kinds of rights back then, the intentions of the parties involved in the contract still need to be taken into account - and even back then it would not have been considered acceptable to spy on the German government," said Gazeas. The treaty, he commented, could not be seen as covering the surveillance of the chancellor's phone in 2013.
Gazeas also has his doubts as to whether these agreements are still valid today. He points out that it is also possible for a contract to be rendered invalid by a statement by one of the relevant parties. The US government's apology to Germany last summer, admitting that the NSA had made mistakes, could, he said, constitute such a statement.
No spying, please!
In an effort to avoid future spying controversies between allies, the European states are working on a so-called "no spying agreement," the signatories of which would promise not to spy on each other. Germany and France, which was also affected by the NSA's surveillance activities, want the US to sign agreements with them to this effect.
Gazeas thinks this is a very good idea. "This kind of agreement, which would also be a valid contract under international law, would set down in black and white that it is absolutely inadmissible to spy on the German federal government. It would eliminate every shred of doubt as to whether this kind of spying is punishable," he said.
From a criminal law standpoint, the tapping of Merkel's phone could be prosecuted as espionage. According to Paragraph 99 of the German criminal code, the "activity of intelligence agents" is punishable - resulting in up to 10 years imprisonment in severe cases. It is, however, unlikely that it will come to that.
"I am certain that in the end there will be no charges against the Americans, but that instead any charges would be dropped," said Gazeas.
In diplomatic circles, however, things are rather different. Earlier this week, Foreign Minister Guido Westerwelle summoned the US ambassador to Berlin, while Merkel called President Barack Obama directly. It could take some time before the great German-American relationship is restored - regardless of whether the eavesdropping by the US was legal or not.