BND, Germany’s foreign intelligence service, used a loophole in the law to snoop on the country’s citizens living abroad from 2000 to 2005, the former agency’s lawyer told German MPs.

Usually, there is law “G10” which specifies high legal hurdles to cover before spying on German citizens, including when they live abroad. If these requirements aren’t met, then the data on them should be filtered from foreign communications received by BND.

However, Dr. Stefan Burbaum told parliament about a loophole: a person was named “office holder” if targeted.

"The office holder is a legal person. It's a small exception. A German citizen can function as an office holder in a foreign organization," Burbaum explained as quoted by the Local.

"The decisive thing is whether he's communicating as a citizen or as an office holder," he added.

BND also breached “G10” legislation regarding telecom traffic, retaining some content the service hadn’t been authorized to check. So the law was turned into a “foot in the door” for some data they wouldn’t have been able to get otherwise, Burbaum said.

The intelligence agency came under heavy fire from MPs.

“This construct of an ‘office holder’ is just as absurd in practice as it appears in the law,” Konstantin von Notz of the Green party said.

Other MPs, from the Social Democratic (SPD), Green and Left (Linke) parties, all slammed the BND for carrying out their activities in a “lawless zone.”

The revelation comes shortly after the German government signed a “no-spying contract” with Canadian smartphone company Blackberry. Under the agreement, German authorities are to audit Blackberry software. The company also has to reveal if they provide users’ information to foreign intelligence.

It follows a statement in the summer that the smartphone giant is set to buy Secusmart, the company which makes secure cell phones, in particular for government officials. There are about 10,000 of these currently in production.

Last year, Edward Snowden revealed in his NSA and GCHQ leaks that the US and UK spy agencies force technology companies to provide user data on a regular basis. Although BND was not on the list, the Chancellor Angela Merkel’s cell phone scandal dragged Germany into the uproar.