KABUL, Afghanistan — The political fallout from a NATO airstrike in Pakistan that was operated out of Afghanistan and killed at least two dozen Pakistani soldiers became clearer on Sunday, as Pakistan seethed over the attack and the United States scrambled to contain the damage to an already frayed relationship.

Afghan officials, meanwhile, worried that they would bear the immediate brunt of Pakistan’s wrath and that the Pakistanis would follow through on threats to withdraw from an international conference on Afghanistan’s security and development that is scheduled for Dec. 5.

Secretary of State Hillary Rodham Clinton called Pakistan’s foreign minister, Hina Rabbani Khar, to discuss the situation, and the chairman of the Joint Chiefs of Staff, Gen. Martin E. Dempsey, talked with Pakistan’s supreme army commander, Gen. Ashfaq Parvez Kayani. General Kayani spent much of the day leading a funeral service in Peshawar, Pakistan, for soldiers who had been killed and visiting others who were wounded in the attack on Saturday.

In her talk with Mrs. Clinton, Ms. Khar conveyed the “deep sense of rage felt across Pakistan,” according to a government statement. Demonstrations expressing anger at the United States broke out in major cities across the country.