In each of those cases, Pakistan had reason to feel that the United States had violated its sovereignty. Even if circumstances on the ground justified the American actions, they have nonetheless made it difficult to sustain political support inside Pakistan for the strategic cooperation that both countries acknowledge is vital to winning the war in Afghanistan. “Imagine how we would feel if it had been 24 American soldiers killed by Pakistani forces at this moment,” Senator Richard J. Durbin, Democrat from Illinois, said on “Fox News Sunday.” The rift is one result of the United States’ two-pronged strategy in Afghanistan, which relies on both negotiating and fighting to end the war.

The latest breach in relations came only five weeks after Secretary of State Hillary Rodham Clinton led a senior American delegation to Pakistan to deliver a blunt warning to the country’s leaders to intensify pressure on extremists carrying out attacks into Afghanistan, while at the same time urging them to help bring more moderate members of the Taliban to the negotiating table.

Mrs. Clinton called the administration’s approach “fight, talk, build,” meaning the United States and its allies would continue to attack militants in Afghanistan and beyond, seek peace talks with those willing to join a political process and build closer economic ties across the region. All are essential to any hope of peace and stability in Afghanistan, and all rely on Pakistan. That has forced the two countries into a strategic alliance whose tactics seem to strain it over and over again.

Mrs. Clinton’s diplomacy — bolstered by Gen. Martin E. Dempsey, the chairman of the Joint Chiefs of Staff, and David H. Petraeus, the director of the C.I.A. — appeared to smooth out the roughest edges in relations, according to officials from both countries.

Recognizing that heightened military activity along the mountainous border with Afghanistan increases the risks of deadly mistakes, American and Pakistani forces have in recent weeks tried to improve their coordination. That cooperation had been largely suspended after the killing of Bin Laden, which President Obama ordered without informing the Pakistani authorities.