Michael Dalder / REUTERS A former monitoring base of the U.S. National Security Agency in Bad Aibling south of Munich, Germany, is seen in a July 10 photo. Chancellor Angela Merkel has defended Germany's cooperation with U.S. intelligence, dismissing comparisons of its techniques to those used in communist East Germany.

German intelligence agencies have used a secret National Security Agency program as part of a U.S. effort to detect possible terrorist activities across the globe, the German magazine Der Spiegel reported Saturday.

Germany’s foreign intelligence service and its domestic intelligence agency were equipped with a program called XKeyScore that, according to documents seen by Der Spiegel reporters, was meant to “expand their ability to support NSA as we jointly prosecute CT [counter-terrorism] targets.”

The German news outlet reported that a 2008 NSA presentation described the program as an effective espionage tool that gathers metadata and can retroactively reveal any terms a target has typed into an online search engine.

The program is also capable of receiving all unfiltered data that a target has accessed over several days, including, in part, the content of communications, the magazine said.

Der Spiegel reported that documents reviewed by its writers said Germany has shown an “eagerness and desire” to aid in U.S. global intelligence gathering efforts.

Another document describes Germany's foreign intelligence service as the NSA’s “most prolific partner” in its intelligence gathering efforts.

The German intelligence agencies and NSA declined to comment to Der Spiegel when asked about the newly reported revelations.

German Chancellor Angela Merkel has said the country is not a "surveillance state" and has pushed back on questions on whether Germany engages in the broad sweeping intelligence gathering programs that alleged NSA leaker Edward Snowden has revealed to the media.