President Barack Obama defended American surveillance programs to the international community on Wednesday, reassuring Germans that their rights were not being infringed.

“What I can say to everybody in Germany and around the world, is this applies very narrowly to leads that we have obtained on issues related to terrorism or proliferation of weapons of mass destruction,” he said at a joint press conference with Germany’s Chancellor Angela Merkel in Berlin. “This is not a situation in which we are rifling through, you know, the ordinary emails of German citizens or American citizens or French or anyone else.”

For weeks the president has been on a similarly defensive footing on the homefront over the National Security Agency’s surveillance policy in the collecting phone and Internet data of Americans. Following news of the programs, Merkel’s political opponents called on her to protect Germans from U.S. surveillance, hitting a nerve with a nation that lived under decades of surveillance by the East German Stasi police.

But Obama reiterated his defense, echoed by top administration officials in Washington this week, that the surveillance aided in thwarting potential terrorist plots, and not just in the U.S. alone.

“As a consequence, we’ve saved lives,” he said. “We know of at least 50 threats that have been averted because of this information, not just in the U.S. but in some cases threats here in Germany. So lives have been saved and the encroachment on privacy has been strictly limited by a court-approved process.”

The president stuck to the talking point that he “welcomes debate” over his controversial national security policies, displaying an openness to dialogue many of his critics view as a facade. “I think one of the things that separates us from some other governments is that we welcome these debates. That’s what a democracy is about,” Obama said,

The chancellor was cautious to stand by the surveillance program, saying only that the conversation between the two countries had begun in earnest and would continue. She noted that “there are quite a lot of instances where we were getting very important information from the United States, for example, the so-called Sauerland Group,” she said, referring to a multi-car bomb plot that was foiled with the help of the CIA in 2009.

Speaking later, at the Brandenburg Gate, the president walked a fine line, reassuring the world, while leaving the door open for discussion.

“We must move beyond the mindset of perpetual war,” the president said Wednesday. “In America,” he said, that also means “balancing the pursuit of security with the protection of privacy. I’m confident that that balance could be struck.”

Wednesday’s speeches stood in stark contrast to the famous speech then-candidate Obama gave in 2008 to more than 200,000 adoring Germans, preaching unity and change.

“This is the moment when we must defeat terror and dry up the well of extremism that supports it. This threat is real and we cannot shrink from our responsibility to combat it,” he said in 2008. ” If we could win a battle of ideas against the communists, we can stand with the vast majority of Muslims who reject the extremism that leads to hate instead of hope.”

Visit NBCNews.com for breaking news, world news, and news about the economy