The Obama administration on Thursday strongly condemned a viral video that apparently depicts Marines desecrating corpses as U.S. officials tried to prevent a popular backlash in Afghanistan and forestall damage to nascent peace talks with the Taliban.

As the images of Marines urinating on three bloodied bodies circulated around the globe, Defense Secretary Leon E. Panetta denounced the video as “utterly deplorable” and called Afghan President Hamid Karzai to assure him that the incident would be thoroughly investigated.

“I wanted him to know how grieved we were at what happened here,” Panetta said in an interview while traveling to Fort Bliss, Tex. “What I want is an investigation into what happened here, what laws were violated by what took place, who these individuals were.”

Secretary of State Hillary Rodham Clinton expressed “total dismay” at the apparent behavior by Marines. Army Gen. Martin E. Dempsey, chairman of the Joint Chiefs of Staff, said that he was “deeply disturbed” and that the actions “erode the reputation of our joint force.”

The swift U.S. response was intended to stave off the kind of international outrage that followed the 2004 release of pictures depicting the humiliating treatment of Iraqi prisoners at Abu Ghraib prison. Military officials said they feared the photographic evidence of apparent Marine misconduct could produce a severe setback at a critical time in Afghanistan.

U.S. officials have stepped up their long-shot efforts to negotiate a political settlement with the Taliban while struggling to maintain support from Karzai. The United States is also confronting an increasingly war-weary population in Afghanistan, where people often lend a sympathetic ear to Taliban propaganda about the presence and motives of foreign troops.

Before receiving Panetta’s call Thursday, Karzai reacted sharply to news of the video, describing it as “completely inhumane and condemnable in the strongest possible terms.” His administration called on the U.S. military to “apply the most severe punishment to anyone found guilty in this crime.”

Panetta said the phone call seemed to mollify the Afghan leader. “He appreciated what I was saying and appreciated the fact we understand how damaging this could be and that we are taking that kind of action.”

Video implicates Marines

The video, which runs for less than a minute, appears to show four Marines in combat gear laughing and joking as they urinate on three male bodies lined up on the ground next to a toppled wheelbarrow. The caption refers to the corpses as “dead Talibans,” but it was unclear whether they were civilians or fighters killed after a battle.

A caption that accompanies the video asserts that the Marines are part of a scout sniper team with the 3rd Battalion, 2nd Marines, an infantry unit from Camp Lejeune, N.C. Marines from the unit were deployed to Afghanistan last year but returned to the United States in September.

The NATO-led security force in Kabul said in a statement that the acts of desecration “appear to have been conducted by a small group of U.S. individuals, who apparently are no longer serving in Afghanistan.” The statement did not elaborate.

A Marine official said investigators were questioning two individuals whom they had preliminarily identified as being in the video. The Marine Corps is “fairly confident” that all four were members of the 3rd Battalion, 2nd Marines, the official said, speaking on the condition of anonymity because the investigation is underway.

It was unclear where or when the video was made. It was posted on the Internet on Wednesday and began to circulate quickly as news sites reported on its existence.

Pentagon officials said that they were still trying to confirm the video’s authenticity but that they had no reason to believe it was a fake. “It certainly appears to us to be what it appears to be to you guys,” Capt. John Kirby, a Defense Department spokesman, told reporters.

Gen. James F. Amos, the commandant of the Marine Corps, said he asked the Naval Criminal Investigative Service to “pull together a team of their very best agents and immediately assign them responsibility to thoroughly investigate every aspect of the filmed event.”

He also said he would assign a Marine general and a senior lawyer to conduct a parallel inquiry. Marine officials said that probe would be led by Lt. Gen. Thomas D. Waldhauser, head of the Marine Corps Forces Central Command.

“Rest assured that the institution of the Marine Corps will not rest until the allegations and the events surrounding them have been resolved,” Amos said.

U.S. military law and the Geneva Conventions prohibit the desecration, mishandling or exploitation of bodies of people killed in war.

Digital dilemma of war

Battlefield videos and photography have become a common hobby among deployed troops. Many amateur productions wind up on the Internet. On occasion, the trend has caused severe embarrassment for the U.S. military, or, in rare cases, such as the Abu Ghraib scandal in Iraq, triggered international controversy and legal action.

Some military analysts praised the Pentagon for its prompt condemnation of the Marines’ apparent behavior but said that such incidents are hardly new in the history of warfare.

“We shouldn’t be shocked that this kind of thing happens in a war,” said Andrew M. Exum, a retired Army captain who served in Afghanistan and is a senior fellow at the Center for a New American Security in Washington. “The difference today is now we have smartphones.”

The Taliban, which has a long-standing reputation for brutality and beheadings, sought to exploit­­ the Marines’ actions. “It was inhuman and despicable, an unforgivable act,” said Taliban spokesman Qari Yousuf Ahmadi.

At the same time, the Taliban did not indicate that it would use the video as an immediate excuse to walk away from the negotiating table. In a statement Thursday, the group said it would continue to pursue a political solution to the decade-long conflict in Afghanistan.

Jaffe reported from Fort Bliss. Correspondent Kevin Sieff in Kabul contributed to this report.