Thirty-one US special forces died in Afghanistan when the Taliban shot down their helicopter, officials said Saturday, the deadliest incident for foreign troops in the decade-long war.

The Americans were killed alongside seven Afghan soldiers during an anti-Taliban operation late Friday when a rocket fired by the insurgents struck their Chinook helicopter in Wardak province, southwest of the capital Kabul.

The death toll was given in a statement from Afghan President Hamid Karzai's office and was not immediately confirmed by the NATO-led International Security Assistance Force (ISAF).

"The president of the Islamic Republic of Afghanistan expresses his sympathy and deep condolences to US President Barack Obama and the family of the victims," it said.

The Afghan defence ministry said the local troops who died were also special forces.

Twenty-five of the dead were US Navy SEALs, US television network ABC News reported. The Pentagon declined to comment on the cause or number of deaths.

The strike was by far the worst to hit foreign troops since American and other international forces invaded Afghanistan to oust the Taliban in 2001 in the wake of the September 11 attacks.

The previous biggest death toll saw 16 American soldiers killed in 2005 when a Taliban rocket hit their Chinook in the eastern province of Kunar.

One man who said he witnessed Friday's crash, Mohammad Saber, told AFP that the helicopter plummeted during a late-night operation in his village.

"At around 10:00pm last night (1730 GMT), we heard helicopters flying over us," he said.

"We were at home. We saw one of the helicopters land on the roof of a house of a Taliban commander, then shooting started.

"The helicopter later took off but soon after taking off it went down and crashed. There were other helicopters flying as well."

Wardak provincial spokesman Shahidullah Shahid said the crash happened in Sayd Abad district during an operation against Taliban insurgents who have been waging war on pro-government forces since being toppled from power in 2001.

"The US chopper that crashed last night was shot down by the Taliban as it was taking off," he said. "A rocket fired by the insurgents hit it and completely destroyed it."

He added that the helicopter had broken into several parts.

The Afghan army commander for the region, General Abdul Razeq, also said the helicopter was "shot down by a rocket fired by the enemy."

A spokesman for ISAF said it would issue a statement "at an appropriate moment."

Taliban spokesman Zabiullah Mujahid said the insurgent group was responsible for shooting down the helicopter, which he said was an American Chinook, and acknowledged that eight insurgents had been killed.

A Western military source speaking on condition of anonymity also confirmed the helicopter type.

Chinooks are widely used by coalition forces in Afghanistan for transporting large numbers of troops and supplies around the war zone.

Elsewhere in eastern Afghanistan Saturday, ISAF said another helicopter made a "precautionary landing" in Khost province, near the border with Pakistan.

A spokesman added that no-one on board was killed and there were no reports of serious injuries. There were no reports of insurgent activity in the area at the time.

The latest deaths take the total number of foreign troops killed in Afghanistan this year to 342, according to an AFP tally based on the independent website Of those, 279 were from the United States.

There are currently about 140,000 foreign troops in Afghanistan, around 100,000 of them from the US.

Some troop withdrawals have already begun as part of a process which is due to see all foreign combat forces leave the country by the end of 2014, although the Taliban are still waging a bloody insurgency.

US special forces play a key role in the war against the Taliban and other insurgents by hunting down and killing fighters in targeted night raids.

Foreign troop commanders say the east of Afghanistan, close to Pakistan where insurgents have hideouts, will likely increasingly overtake the south as the focus of the war in coming months.