US Defence Secretary Leon Panetta has condemned as "utterly deplorable" a video that purports to depict four US Marines urinating on the corpses of Taliban fighters.
He said such behaviour is "entirely inappropriate for members of the United States military" and those responsible will be held accountable.
Panetta said he had ordered the Marine Corps and Marine Gen John Allen, the top commander of the Nato-led forces in Afghanistan, to investigate.
The Marine Corps said earlier it would investigate the YouTube video but had not yet verified its origin or authenticity. The case has been referred to the Naval Criminal Investigative Service, the US Navy's worldwide law enforcement arm.
The video, posted on the internet, shows men in Marine combat gear, standing in a semi-circle over three bodies.
It is not clear whether the dead were Taliban or civilians or someone else. The title on the posting called them Taliban insurgents but it was unclear who added that title, Marine Corps officials in Washington said.
The reaction from Afghanistan was angry.
Afghan President Hamid Karzai condemned the video as "completely inhumane". The Afghan Defence Ministry called it "shocking". And the Taliban issued a statement accusing US forces of committing numerous "indignities" against the Afghan people.
"First they killed the Afghans with mortars, and they then urinated on their bodies," Taliban spokesman Zabiullah Mujahid said. "We strongly condemn this inhumane action by the wild American soldiers."
Panetta said the actions, if true, were inexcusable.
"I have seen the footage, and I find the behaviour depicted in it utterly deplorable. I condemn it in the strongest possible terms," Panetta's statement said. "Those found to have engaged in such conduct will be held accountable to the fullest extent."
The video came to light at a delicate time in relations among the United States, Afghanistan's elected government and the Taliban insurgency fighting for both territorial control and cultural and religious pre-eminence in Afghanistan.
The US is trying to foster peace talks between the Karzai government and the Pakistan-based Taliban high command, and has made unprecedented offers to build trust with the insurgents, including the planned opening of a Taliban political office to oversee talks.
One of the largest obstacles to peace discussions has been widespread Afghan contempt for US military tactics that many - both Taliban sympathisers and not - see as heavy-handed.
Opposition to the US and Nato military presence in Afghanistan usually centres on civilian casualties from military engagement, although the vast majority of those deaths are caused by the insurgents.
Although the video purports to show Taliban fighters, not civilians, it is likely to resonate with those opposed to the US presence and to peace with the US-backed Karzai government. In his statement, Karzai called on the US military to punish the Marines.
The Nato-led security force in Afghanistan released a statement saying: "This disrespectful act is inexplicable and not in keeping with the high moral standards we expect of coalition forces."
The actions "appear to have been conducted by a small group of US individuals, who apparently are no longer serving in Afghanistan", the International Security Assistance Force said. The statement did not identify the personnel or explain why the ISAF thought they had left the country.
A spokesman at Camp Lejeune in North Carolina would not confirm reports that the Marines were based there. "We have had elements of that unit that have deployed to Afghanistan and have returned. However, we have not yet confirmed if anyone in the video is from that unit, or whether they are attached to a unit from Lejeune," said Capt Scott Sasser.
Senator John McCain, a Navy veteran who fought and was held prisoner in the Vietnam war, said the incident "makes me so sad".
McCain, the top Republican on the Senate Armed Services Committee, called the Marine Corps one of America's strongest institutions and said its image has apparently been tarnished by "a handful of obviously undisciplined people".
"There should be an investigation and these young people should be punished," he said.
Pentagon officials said the criminal investigation was likely to look into whether the Marines violated laws of war, which include prohibitions against photographing bodies and detainees and a range of other rules.
In an emailed statement, Taliban spokesman Mujahid said, "During these 10 years American soldiers have tortured our people in various ways, they have shown disrespect to the holy Koran and other holy books, they have burned our bodies, they have killed and tortured our women and children and ... have committed other hateful actions."
Mujahid urged the UN and other international groups to end such actions by US troops.
the Council on Islamic-American Relations, a prominent Muslim civil rights and advocacy group based in Washington, protested the video in a letter to Panetta.
"We condemn this apparent desecration of the dead as a violation of our nation's military regulations and of international laws of war prohibiting such disgusting and immoral group wrote.
"If verified as authentic, the video shows behaviour that is totally unbecoming of American military personnel and that could ultimately endanger other soldiers and civilians," the letter said.