Angela Merkel and Barack Obama
Angela Merkel and Barack ObamaReuters

The head of the United States national intelligence said on Tuesday that the U.S. has commonly spied on leaders of its foreign allies for decades, just as they are spying on American officials.

National Intelligence Director James Clapper told Congress on Tuesday that it is “kind of a basic tenet” of U.S. intelligence-gathering to find out the intentions of foreign leaders, according to The Associated Press.

Clapper said the intelligence gathering is done to make sure “what they are saying gels with what’s actually going on” and to determine how allies’ policies would impact the U.S.

Clapper also said allies have “absolutely” spied on U.S. officials.

He did not offer any specifics.

The head of the National Security Agency (NSA) defended the spy agency as acting within legal boundaries, amid a public uproar which has grown from anger over the collection of Americans' phone and email records to outrage over spying on European allies.

General Keith Alexander offered an impassioned defense of the beleaguered intelligence agency, telling the House of Representatives Intelligence Committee that the NSA is focused on preventing attacks on Americans and allies, and operates under strict oversight.

"It is much more important for this country that we defend this nation and take the beatings than it is to give up a program that would result in this nation being attacked," Alexander said, referring to criticism of his agency, according to the Reuters news agency.

Under sympathetic questioning from the committee chairman, Representative Mike Rogers, Alexander called media reports in France, Spain and Italy that the NSA collected data on tens of millions of phone calls in those countries "completely false."

Some of the data referenced in documents leaked by former NSA contractor Edward Snowden was collected not just by the NSA itself but was also "provided to NSA by foreign partners," he said.

"This is not information that we collected on European citizens. It represents information that we and our NATO allies have collected in defense of our countries and in support of military operations," said Alexander, according to Reuters.

Rogers warned that collecting foreign intelligence was important to protecting Americans and allies from terrorism.

"Every nation collects foreign intelligence. That is not unique to the United States," Rogers said in prepared opening remarks at the committee hearing. "What is unique to the United States is our level of oversight, our commitment to privacy protections, and our checks and balances on intelligence collection."

Recent reports show the NSA had monitored the cellphone conversations of German Chancellor Angela Merkel. The White House is considering banning eavesdropping on friendly foreign leaders.

On Saturday, the German Der Spiegel magazine reported that leaked NSA documents showed Merkel's phone had appeared on a list of spying targets for over a decade, and was still under surveillance weeks before Obama visited Berlin in June.

On Sunday, the German newspaper Bild am Sonntag newspaper quoted U.S. intelligence sources as saying that Alexander had briefed Obama on the operation against Merkel in 2010.

The United States denied, however, that the President was personally informed for years of electronic surveillance against the German chancellor.