Pakistan, enraged by a NATO cross-border air attack that killed 24 soldiers, could withdraw its support for the U.S. war on militancy if its sovereignty is violated again, the foreign minister suggested in comments published on Thursday.

The South Asian nation has already shown its anger over the weekend strike by pulling out of an international conference in Germany next week on Afghanistan's future.

Islamabad stood by its decision on Wednesday despite German hopes to the contrary, depriving the talks of a central player in efforts to bring peace to Afghanistan.

Enough is enough. The government will not tolerate any incident of spilling even a single drop of any civilian or soldier's blood, The News newspaper quoted Foreign Minister Hina Rabbani Khar as telling a Senate committee on foreign affairs.

Pakistan's role in the war on terror must not be overlooked, Khar said, suggesting Pakistan could end its support for the U.S. war on militancy. Despite opposition at home, Islamabad backed Washington after the September 11, 2001, attacks on the United States.

NATO helicopters and fighter jets attacked two military border posts in northwest Pakistan on Saturday in the worst incident of its kind since 2001.

The top U.S. military officer on Wednesday denied allegations by a senior Pakistani army official that the NATO attack was a deliberate act of aggression.

General Martin Dempsey, chairman of the U.S. military's Joint Chiefs of Staff, told Reuters in an interview: The one thing I will say publicly and categorically is that this was not a deliberate attack.

The army, which has ruled Pakistan for more than half of its history and sets security and foreign policy, faced strong criticism from both the Pakistani public and its ally, the United States, after Osama bin Laden was killed.

The al Qaeda leader had apparently been living in a Pakistani garrison town for years before U.S. special forces found and killed him in a unilateral raid in May.

Pakistanis criticised the military for failing to protect their sovereignty, and angry U.S. officials wondered whether some members of military intelligence had sheltered him. Pakistan's government and military said they had no idea bin Laden was in the country.

The army seems to have regained its confidence, and won the support of the public and the government in a country where anti-American sentiment often runs high.

Protests have taken place in several cities every day since the NATO strike along the poorly-defined border, where militants often plan and stage attacks.

In an apparently unrelated attack, a bomb blew out a wall of a government official's office in Peshawar, the last big city on the route to Afghanistan, early on Thursday, police said. There were no reports of casualties.

The United States has long wanted Pakistan, whose military and economy depends heavily on billions of dollars in American aid, to crack down on militant groups that cross its unruly border to attack Western forces in Afghanistan.

More recently, U.S. Secretary of State Hillary Clinton asked Pakistan during a visit to Islamabad in which she met Khar to bring all militant groups to the negotiating table in order to stabilise neighbouring Afghanistan.

The NATO attack makes Pakistani cooperation less likely.

NATO hopes an investigation it promised will defuse the crisis and that confidence-building measures can repair ties.

But the army is firmly focused on the NATO attack, and analysts say it is likely to take advantage of the widespread anger to press its interests in any future peace talks on Afghanistan.

Pakistan says it has paid the highest price of any country engaged in the war on militancy. Thousands of soldiers and police have been killed.

Critics allege Pakistan has created a deadly regional mess by supporting militants like the al Qaeda-linked Haqqani network to act as proxies in Afghanistan and other groups to fight Indian forces in the disputed Kashmir region.

The sacrifices rendered by Pakistan in the war on terror are more than any other country, Khar was quoted as saying. But that does not mean we will compromise on our sovereignty.

(Additional reporting by Jibran Ahmad in PESHAWAR; Editing by Paul Tait)