Updated

The NATO airstrikes that killed 24 Pakistani soldiers that lasted almost two hours and continued even after commanders at the bases pleaded with coalition forces to stop, Pakistan's military claimed Monday, was likely due to the mistaken ID of Pakistani troops as militants.

NATO has described the incident as "tragic and unintended" and has promised a full investigation.

Unnamed Afghan officials have said that Afghan commandos and U.S. special forces were conducting a mission on the Afghan side of the border and took incoming fire from the direction of the Pakistani posts. They responded with airstrikes.

Ties between Pakistan and the United States were already deteriorating before the deadly attack and have sunk to new lows since, delivering a major setback to American hopes of enlisting Islamabad's help in negotiating an end to the 10-year-old Afghan war.

Army spokesman Maj. Gen. Athar Abbas said the Pakistani troops at two border posts were the victims of unprovoked aggression. He said the attack lasted almost two hours and that commanders had contacted NATO counterparts while it was going on, asking that "they get this fire to cease, but somehow it continued."

More On This...

The Pakistan army has previously said its soldiers retaliated "with all weapons available" to the attack.

The poorly defined, mountainous border has been a constant source of tension between Pakistan and the United States. NATO officials have complained that insurgents fire from across the frontier, often from positions close to Pakistani soldiers who have been accused of tolerating or supporting the militants. NATO and Afghan forces are not allowed to cross over into Pakistan in pursuit of militants.

Saturday's strikes added to popular anger in Pakistan against the U.S.-led coalition presence in Afghanistan. Many in the army, parliament, general population and media already believed that the U.S. and NATO are hostile to Pakistan and that the Afghan Taliban are not the enemy.

"Whoever is a friend of America is a traitor to the land," around 400 members of Jamaat-e-Dawa, an alleged front group for the militant Lashkar-e-Taiba organization, chanted in a demonstration in Karachi, the country's biggest city.

While the United States is widely disliked in Pakistan, the army has accepted billions in American aid over the last 10 years in return for its cooperation in fighting al-Qaida. It has been accused of fomenting anti-American sentiment in the country to extract better terms in what is essentially a transactional and deeply troubled relationship with Washington.

Saturday's deadly incident also serves to shift attention away from the dominant perception of the Pakistani army in the West over the last five years -- that of an unreliable ally that supports militancy. That image was cemented after al-Qaida's chief Osama bin Laden was found to have been hiding in an army town close to the Pakistani capital when he was killed.

For Pakistan's weak and much criticized elected government, Saturday's airstrikes provide a rare opportunity to unite the country and a momentary relief from attack by rivals eyeing elections in 2013 or sooner.

By contrast, deaths of soldiers and civilians in attacks by militants, some with alleged links to the country's spy agencies, are often greeted with official silence.

Abbas dismissed Afghanistan's claims that the joint Afghan-NATO troops were fired upon first.

"At this point, NATO and Afghanistan are trying to wriggle out of the situation by offering excuses," he said. "Where are their casualties?"

Abbas said the two military posts, named "Volcano" and "Golden," were situated on a ridge in Mohmand region around 300 yards from the border with Afghanistan. He said their exact location had been provided to NATO and that the area had recently been cleared of militants.

Hours after the attack on Saturday, Pakistan closed its western border to trucks delivering supplies to NATO troops in Afghanistan, demanded that the U.S. abandon an air base inside Pakistan used to operate drone strikes, and said it will review its cooperation with the U.S. and NATO.

However, a complete breakdown in the relationship between the United States and Pakistan is considered unlikely. Pakistan relies on billions of dollars in American aid, and the U.S. needs Pakistan to push Afghan insurgents to participate in peace talks.

After the bin Laden raid, ties almost collapsed but slowly resumed, albeit at a lower level and with lower expectations on the American side.

Despite high-tech targeting systems, accidents in the "fog of war" happen often.

NATO has hit friendly forces, civilians and even a diplomatic mission in conflicts in Afghanistan, Libya and Serbia.

During the 1999 bombing of Serbia, NATO jets struck the Chinese Embassy in Belgrade by mistake, killing three Chinese reporters. Canadian and British troops were killed in "friendly fire" incidents involving NATO airpower in Afghanistan. In Libya, NATO reportedly bombed opposition fighters at least twice during the seven-month campaign.