Pakistani protesters shout slogans against America and NATO in Lahore after Pakistan accused NATO helicopters and fighter jets of firing on two army checkpoints in the country's northwest and killing 24 soldiers. (K.M.Chaudary/AP)

As Pakistan buried 24 soldiers Sunday who were killed in a NATO airstrike the day before, the nation’s top officials continued to convey anger over the incident to its American and Afghan allies.  

Trucks carrying cargo to coalition troops in Afghanistan remained backed up for a second day at the two main border crossings in Pakistan, which shut the passes in retaliation for an attack it denounced as unprovoked. 

In an early morning call to Secretary of State Hillary Rodham Clinton, Pakistan’s foreign minister, Hina Rabbani Khar, said the incident “negates the progress made by the two countries on improving relations.” The Pakistani foreign office said it had also lodged a protest with Afghanistan, urging the neighboring country to take “necessary measures” to prevent future airstrikes from its soil.

In a statement, Anders Fogh Rasumussen, NATO’s secretary general, called the airstrike a “tragic unintended incident.”

“The deaths of Pakistani personnel are as unacceptable and deplorable as the deaths of Afghan and international personnel,” Rasumussen said.

The airstrike, which NATO says it is investigating, has stirred public anger at the United States, which many Pakistanis view more as an adversary than partner. A headline in Sunday’s “The News,” an English-language newspaper, referred to the incident as a “slaughter.” Thousands of people protested outside the U.S. consulate in the southern city of Karachi, according to the Reuters news agency.

The Pakistani military said Saturday that NATO helicopters and fighter jets had fired on two border checkpoints and killed 24 soldiers, an incident that sent the two nations’ uneasy alliance into new crisis and fanned domestic criticism of Pakistan’s cooperation with the American war effort in Afghanistan.

Pakistan issued swift and furious condemnations of the early morning strike in the Mohmand tribal region along the Afghan border, which the military deemed unprovoked “aggression.” Within hours of the incident, Pakistan responded by shutting down the two border crossings used by trucks to ferry about half of supplies to coalition troops fighting in Afghanistan. Pakistan does not allow those coalition forces to enter or fire inside its territory.

The strike, which NATO officials in Kabul said was being investigated, came toward the end of a year in which the bilateral relationship has suffered unprecedented blows, including the American raid to kill Osama bin Laden in Pakistan in May. As it did in that operation, Pakistan condemned the Saturday strike as an intolerable breach of sovereignty, one officials and politicians said demonstrated American disregard for Pakistani life and would stoke terrorism.

Clinton and Defense Secretary Leon E. Panetta said in a joint statement late Saturday that they offered their “deepest condolences for the loss of life and support fully NATO’s intention to investigate immediately.” Clinton and other senior U.S. officials spoke to their Pakistani counterparts by phone, stressing “the importance of the U.S.-Pakistani partnership,” the statement said.

A senior military official in Washington said that “everybody is taking this very, very seriously. There’s no question about that.” The official and others, who would not speak on the record about the sensitive issue, said the incident followed months of tension along the border amid a U.S. offensive against Pakistan-based insurgents in eastern Afghanistan.

During previous exchanges of ground fire across the border, Pakistani officials have said that any firing from their side came from insurgents, not Pakistani troops. Although Pakistan has said Saturday’s incident was unprovoked, the sequence of events remained unclear to U.S. officials, who said that initial indications were that U.S. and Afghan troops came under fire from the Pakistani side and called in air support.

The two countries have weathered the past crises, citing a mutually dependent relationship in which Pakistan receives billions of dollars in aid and the United States gains supply routes and assistance fighting militants. U.S. and Pakistani officials say relations have improved since the October visit by Clinton, who prodded Pakistan to aggressively target insurgents in the tribal areas but also asked for Pakistani assistance in potential peace talks with the Taliban.

Last year, Pakistan shut down the Torkham border crossing for 10 days after a NATO airstrike killed two Pakistani soldiers. The United States apologized after a joint investigation that deemed the incident an accident.

But the alleged death toll in Saturday’s strike would be the largest of any similar incident in the two nations’ decade-long alliance, and Pakistani officials indicated that they would be less willing to forgive.

The powerful army chief, Gen. Ashfaq Parvez Kayani, demanded in a statement that “all necessary steps be undertaken for an effective response to this irresponsible act.” The Pakistani government said it was “deeply incensed” and warned of “serious repercussions” for Pakistan’s cooperation with the United States and international forces in Afghanistan. After a late-night meeting, the cabinet’s defense committee indicated that the border crossings would be closed indefinitely.

Both the U.S. ambassador to Pakistan, Cameron Munter, and the commander of the U.S.-led coalition in Afghanistan, Gen. John Allen, expressed regret for Pakistani casualties.

“This incident has my highest personal attention and my commitment to thoroughly investigate it to determine the facts,” Allen said in a statement, which also offered his condolences. “My most sincere and personal heartfelt condolences go out to the families and loved ones of any members of Pakistan Security Forces who may have been killed or injured.”

The defense committee, in a statement, also pledged to make U.S. military personnel vacate an air base in southwestern Pakistan within 15 days. U.S. drone aircraft attacking western Pakistan had flown from a small airstrip at the Shamsi base. Since April, all U.S. drone attacks in Pakistan have been flown from bases in Afghanistan, but a small contingent of fewer that a dozen Americans had remained at Shamsi.

The poorly patrolled and ill-marked border is the central sore point in Pakistan’s relations with both the United States and Afghanistan. American military officials say al-Qaeda and Afghan Taliban fighters live on the Pakistani side and cross the border to attack U.S. troops — with the knowledge of and help from Pakistani intelligence. Pakistan says the homegrown militants its army is fighting in the restive tribal areas can easily find refuge in eastern Afghanistan, which borders Mohmand, and that CIA drone strikes in the region inspire militants.

The Saturday airstrike came one day after Allen met with Kayani to discuss border security.

The strike in the village of Salala injured 13 troops, the military said. A private Pakistani television network aired video of camouflage-clad soldiers at a chaotic scene, some of whom were lying on cots and appeared to be wounded.

Pakistan closed both the Torkham and Chaman passes in response to the attack. Idling Afghanistan-bound trucks lined up at the frontiers, and their Pakistani drivers said they worried that the vehicles would be attacked by militants.

The airstrike seemed certain to stoke anti-American sentiment in Pakistan, where many view the United States as an enemy and blame it for an increase in deadly militant attacks across Pakistan. That stance has become more prominent with the rising popularity of cricket star-turned-politician. Imran Khan, the cricket star turned rising politician, told thousands of supporters at a rally Saturday that it was time to end the U.S. alliance with the United States. “Americans are attacking and killing our soldiers,” Khan said. “We have been crying for a long time that this is not our war.”

Staff writer Karen DeYoung in Washington, special correspondent Haq Nawaz Khan in Peshawar, Pakistan, and correspondent Joshua Partlow in Kabul contributed to this report.