The director of the National Security Agency has blamed US diplomats for requests to place foreign leaders under surveillance, in a surprising intervention that risks a confrontation with the State Department.

General Keith Alexander made the remarks during a pointed exchange with a former US ambassador to Romania, lending more evidence to suggestions of a rift over surveillance between the intelligence community and Barack Obama's administration.

The NSA chief was challenged by James Carew Rosapepe, who served as an ambassador under the Clinton administration, over the monitoring of the German chancellor Angela Merkel's phone.

Rosapepe, now a Democratic state senator in Maryland, pressed Alexander to give "a national security justification" for the agency's use of surveillance tools intended for combating terrorism against "democratically elected leaders and private businesses".

"We all joke that everyone is spying on everyone," he said. "But that is not a national security justification."

Alexander replied: "That is a great question, in fact as an ambassador you have part of the answer. Because we the intelligence agencies don't come up with the requirements. The policymakers come up with the requirements."

He went on: "One of those groups would have been, let me think, hold on, oh: ambassadors."

Alexander said the NSA collected information when it was asked by policy officials to discover the "leadership intentions" of foreign countries. "If you want to know leadership intentions, these are the issues," the NSA director said.

The exchange on Thursday night drew laughs from the audience at the Baltimore Council on Foreign Relations, but did not seem to impress the former ambassador, who replied: "We generally don't do that in democratic societies."

It also risked deepening the division between the Obama administration and the intelligence community, which have been briefing against one another throughout the week.

Alexander had previously insinuated that targets of surveillance emerged from elsewhere in the administration, but this is the first time he is known to have publicly singled out US diplomats.

Just hours earlier, secretary of state John Kerry appeared to lay the blame at the door of the NSA, when he said certain practices had occurred "on autopilot" without the knowledge of senior officials in the Obama administration.

Alexander was asked by the Guardian how he thought Merkel, who grew up in East Germany when the Stasi secret service was operating, might have felt when she discovered her phone had been monitored by the NSA. "I don't know, I don't know the answer," he said. "You know, I would say 'alleged'."

Asked why he would say "alleged", given he presumably knows the monitoring occurred, Alexander said: "I say alleged because there are no facts ... that are on the table."

But Alexander also opened the door to the US halting surveillance of foreign leaders, hinting that it might be in the best interests of the US to suspend some surveillance programs to guarantee support to combat terrorism.

"I think those partnerships have greater value than some of the collection," he said. "And we ought to look at it like that."

Alexander, who is soon stepping down from the NSA, spoke after an eight-day period in which his agency has faced a growing chorus of criticism over its activities, particularly in relation to allied nations such as Germany.

The NSA may also lose its ability to gather domestic phone data – a program Alexander has previously sought to guard.

In his speech in Baltimore, Alexander adopted a slightly different tone, suggesting he was "not wedded" to the program if a better alternative could be found.

Competing legislation has been introduced in the House and Senate this week to reform the NSA and the secret surveillance court that is supposed to hold it to account. One bill, which has growing support on Capitol Hill, would effectively end the routine collection of phone records data.

"I am not wedded to these programs," Alexander said in his opening remarks. "If we can come up with a better way of doing them, we should. Period." Speaking specifically about the collection of phone records, he compared administering the program to holding a "hornets' nest".

"We're holding this hornets' nest for the good of the nation. We would love to put it down, we would like to cast it aside, but if we do it is our fear that there will be a gap – and the potential for another 9/11 – and we would not have done our duty. So our duty would be: find another way."

The reference to the September 11, 2001, attacks was consistent with previous remarks. On Wednesday, al-Jazeera published a master list of NSA "talking points", obtained under the Freedom of Information Act.

Under the subheading “Sound Bites That Resonate”, the memo encourages references to 9/11 as justification for its mass surveillance.

"You know, every one of us remembers 9/11," Alexander told the audience in Baltimore. "You remember where you were, what was going on, what happened when the first plane hit, what was going on when the second plane hit – it changed our lives."

Alexander recalled firefighters killed trying help victims of the attack, and invoked the image of a fireman, during 9/11, "handing the flag" to the military and intelligence community. "We, the military and intelligence community, said 'we've got it from here'," he said. "That is etched on our hearts and our minds forever."