US President Barack Obama has said he would order a similar operation to that which killed Osama Bin Laden if another militant leader was found in Pakistan.
He said the US was mindful of Pakistani sovereignty but said the US could not allow "active plans to come to fruition without us taking some action".
The killing of Bin Laden by US forces in a Pakistani garrison town on 2 May strained ties between the two allies.
President Obama was speaking to the BBC ahead of a European visit.
Asked what he would do if one of al-Qaeda's top leaders, or the Taliban leader Mullah Omar, was tracked down to a location in Pakistan or another sovereign territory, he said the US would take unilateral action if required.
"Our job is to secure the United States," he told the BBC's Andrew Marr during a wide-ranging interview.
"We are very respectful of the sovereignty of Pakistan. But we cannot allow someone who is actively planning to kill our people or our allies' people.
"We can't allow those kind of active plans to come to fruition without us taking some action."
Bin Laden, the Saudi-born leader of al-Qaeda, was killed in a raid by US Navy Seal commandos. They stormed the compound where he was living in Abbottabad, a town that is home to Pakistan's main military academy.
The discovery that Bin Laden had been living there embarrassed the Pakistani military, and led to renewed suspicions that he had enjoyed protection from some members of the Pakistani security forces.
The Islamabad government strongly denied such suggestions and said the US raid had undermined the country's sovereignty.
A resolution approved by Pakistani MPs earlier this month said the country would "no longer tolerate such actions and a repeat of unilateral measures could have dire consequences for peace and security in the region and the world".
Pakistan has been a major ally in the war against militants in neighbouring Afghanistan.
But US-Pakistani relations have also been strained by drone strikes targeting militants in the border area in recent years.
Reflecting on the raid - which he and his aides followed from the White House - Mr Obama said "that was as long a 40 minutes as I care to experience during my presidency".
He added that the killing of Bin Laden could be a "wake-up call where we start seeing a more effective co-operative relationship" with Pakistan.
Talking to the Taliban
On Afghanistan, Mr Obama said that while the conflict could not be solved militarily, raising troop levels had put the Taliban "back on its heels" in a way that could facilitate the brokering of a political reconciliation.
"Ultimately it means talking to the Taliban," he said, adding that the "Taliban would have to cut all ties to al-Qaeda, renounce violence and they would have to respect the Afghan constitution".
Afghan presidential spokesman Waheed Omar welcomed this suggestion, saying it reflected Kabul's long-held view. "We're glad that we now have clear words from the president of the United States about it," Mr Omar told the BBC.
In a discussion that ranged from the US economy to Middle East peace talks and his family's fondness for the British monarch, Mr Obama:
President Obama is due to leave for Europe later on Sunday. He will first visit the Irish Republic, then the UK, France, and Poland.
He is expected to discuss a range of issues, including the upheavals in the Middle East and North Africa, the war in Afghanistan, and the downturn that has forced European governments to adopt austerity measures.