The United States on Saturday vowed to "stay the course" in Afghanistan after 30 US soldiers were killed there when, according to local officials, the Taliban shot down their helicopter.

The pledge from US Defense Secretary Leon Panetta -- and a salute from President Barack Obama -- came after the US troops, an interpreter and seven Afghan soldiers were killed during an anti-Taliban operation late Friday.

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.

Twenty-five of the dead were US Navy SEALs, US television network ABC News reported. Sources in the Obama administration told AFP that the victims came from the army, navy and air force, without saying if they were SEALs.

"Their courage was exemplary, as was their determination to make this a safer world for their countries and for their fellow citizens," Panetta in a statement.

"We will stay the course to complete that mission, for which they and all who have served and lost their lives in Afghanistan have made the ultimate sacrifice."

The Pentagon declined to comment on the cause of the crash but said it had launched an investigation of the incident. The top US military officer, Admiral Mike Mullen, warned against drawing hasty conclusions.

"Information is still coming in about this incident. I think it's important that we allow investigators to do their work before jumping to too many conclusions," Mullen said in a statement.

"We also need to make sure we remain committed to the mission. The fight goes on," said Mullen, who is chairman of the US Joint Chiefs of Staff.

"The best way we can honor that sacrifice is to keep at it, keep fighting, keep moving forward."

Afghan officials said a rocket fired by Taliban insurgents struck a Chinook helicopter carrying the US and Afghan forces in Wardak province, southwest of the Afghan capital Kabul.

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

The NATO-led International Security Assistance Force (ISAF) said Saturday that 30 ISAF service members -- all of them Americans -- one civilian interpreter and seven Afghan commandos were killed in the incident.

ISAF did not say anything about why the Chinook had crashed.

Obama said Saturday that the deaths of the US soldiers were "a reminder of the extraordinary sacrifices made by the men and women of our military and their families, including all who have served in Afghanistan."

"We will draw inspiration from their lives, and continue the work of securing our country and standing up for the values that they embodied," he said in a White House statement.

"We also mourn the Afghans who died alongside our troops in pursuit of a more peaceful and hopeful future for their country."

Sources in the Obama administration refused to comment on whether the dead were Navy SEALs, saying only they were "not part" of the team that killed Al-Qaeda leader Osama bin Laden in a May raid in Pakistan.

The sources also declined to confirm the death toll given by Afghan officials.

Several US media outlets said the victims were members of "Team Six," the elite SEALs unit behind the Bin Laden raid.