NATO helicopters and fighter jets attacked two military outposts in northwestern Pakistan on Saturday, killing as many as 28 troops and plunging U.S.-Pakistan relations deeper into crisis.

Pakistan retaliated by shutting down NATO supply routes into Afghanistan, used for sending in nearly half of the alliance's land shipments. It also said it would ask U.S. forces to quit an air base used for CIA drone strikes on militants.

The attack is the worst incident of its kind since Pakistan uneasily allied itself with Washington following the September 11, 2001 attacks on the United States.

The NATO-led force in Afghanistan confirmed that NATO aircraft had probably killed Pakistani soldiers in an area close to the Afghan-Pakistani border.

Close air support was called in, in the development of the tactical situation, and it is what highly likely caused the Pakistan casualties, said General Carsten Jacobson, spokesman for the International Security Assistance Force (ISAF).

He added he could not confirm the number of casualties, but ISAF was investigating. We are aware that Pakistani soldiers perished. We don't know the size, the magnitude, he said.

Pakistan's Prime Minister Yusuf Raza Gilani said the killings were an attack on Pakistan's sovereignty, adding: We will not let any harm come to Pakistan's sovereignty and solidarity.

The Foreign Office said it would take up the matter in the strongest terms with NATO and the United States, while the Chief of Army Staff, General Ashfaq Pervez Kayani, said steps would be taken to respond to this irresponsible act.

A strong protest has been launched with NATO/ISAF in which it has been demanded that strong and urgent action be taken against those responsible for this aggression.

Two military officials said up to 28 troops had been killed and 11 wounded in the attack on the outposts, about 2.5 km (1.5 miles) from the Afghan border. The Pakistani military said 24 troops were killed and 13 wounded.

EARLY MORNING ATTACK

The attack took place around 2 a.m. (2100 GMT) in the Baizai area of Mohmand, where Pakistani troops are fighting Taliban militants. Across the border is Afghanistan's Kunar province, which has seen years of heavy fighting.

Pakistani troops effectively responded immediately in self-defense to NATO/ISAF's aggression with all available weapons, the Pakistani military statement said.

The commander of NATO-led forces in Afghanistan, General John R. Allen, offered his condolences to the families of Pakistani soldiers who may have been killed or injured.

In Washington, a Pentagon spokesman said Defense Secretary Leon Panetta was aware of reports of the incident and was monitoring the situation.

[The defense secretary] shares General Allen's regret for any loss of life and supports the general's work to immediately investigate, said spokesman Captain John Kirby.

There was no immediate comment on the report of U.S. forces being asked to vacate a Pakistani base or on the closure of the Pakistani border crossing to trucks carrying supplies for ISAF forces.

Around 40 troops were stationed at the outposts, military sources said. Two officers were reported among the dead. They without any reasons attacked on our post and killed soldiers asleep, said a senior Pakistani officer, requesting anonymity.

The border is often poorly marked, and Afghan and Pakistani maps have differences of several kilometers in some places, military officials have said.

However Pakistani military spokesman Major-General Athar Abbas said NATO had been given maps of the area, with Pakistani military posts identified.

When the other side is saying there is a doubt about this, there is no doubt about it. These posts have been marked and handed over to the other side for marking on their maps and are clearly inside Pakistani territory.

The incident occurred a day after Allen met Kayani to discuss border control and enhanced cooperation.

A senior military source told Reuters that after the meeting that set out to build confidence and trust, these kind of attacks should not have taken place.

BLOCKED SUPPLIES

Pakistan is a vital land route for nearly half of NATO supplies shipped overland to its troops in Afghanistan, a NATO spokesman said. Land shipments account for about two thirds of the alliance's cargo shipments into Afghanistan.

Hours after the raid, NATO supply trucks and fuel tankers bound for Afghanistan were stopped at Jamrud town in the Khyber tribal region near the city of Peshawar, officials said.

The border crossing at Chaman in southwestern Baluchistan province was also closed, Frontier Corps officials said.

A meeting of the cabinet's defense committee convened by Gilani decided to close with immediate effect NATO/ISAF logistics supply lines, according to a statement issued by Gilani's office.

The committee decided to ask the United States to vacate, within 15 days, the Shamsi Air Base, a remote installation in Baluchistan used by U.S. forces for drone strikes, which has long been at the center of a dispute between Islamabad and Washington.

The meeting also decided the government would revisit and undertake a complete review of all programs, activities and cooperative arrangements with US/NATO/ISAF, including diplomatic, political, military and intelligence.

A similar incident on Sept 30, 2010, which killed two Pakistani service personnel, led to the closure of one of NATO's supply routes through Pakistan for 10 days. NATO apologized for that incident, which it said happened when NATO gunships mistook warning shots by Pakistani forces for a militant attack.

Relations between the United States and Pakistan were strained by the killing of al Qaeda leader Osama bin Laden by U.S. special forces in Pakistan in May, which Pakistan called a flagrant violation of sovereignty.

Pakistan's jailing of a CIA contractor and U.S. accusations that Pakistan backed a militant attack on the U.S. embassy in Kabul have added to the tensions.

This will have a catastrophic effect on Pakistan-U.S. relations. The public in Pakistan are going to go berserk on this, said Charles Heyman, senior defense analyst at British military website Armedforces.co.uk.

Other analysts, including Rustam Shah Mohmand, a former ambassador to Afghanistan, predicted Pakistan would protest and close the supply lines for some time, but that ultimately things will get back to normal.

(Additional reporting by Bushra Takseen, Saud Mehsud, Jibran Ahmad and Saeed Achakzai in Pakistan, Tim Castle in London, and Hamid Shalizi and Christine Kearney in Afghanistan; Writing by Augustine Anthony, Chris Allbritton and Emma Graham-Harrison; Editing by Andrew Roche and Rosalind Russell)