(CNN) -- The deputy commander of U.S. forces in Afghanistan ordered troops Friday to treat the corpses of slain insurgents and civilians with "appropriate dignity and respect."
The order follows a video that appears to show four U.S. Marines urinating on bodies, images that sparked swift condemnation from the United States and Afghanistan at a particularly crucial period in the U.S.-led war.
"We must treat the living and the dead with dignity and respect," Gen. Curtis Scaparrotti said in the directive, which was published Friday on the website of the NATO-led force in Afghanistan. He said troops must follow the rules of armed conflict and "act honorably at all times."
"In order to prevail, for the good of the coalition nations and the Afghan people, we can do no less."
The video surfaced as the United States and the Taliban have taken tentative steps toward peace negotiations and as the U.S. and its allies plan to withdraw troops by the end of 2014.
The general's directive instructed officers to ensure subordinates know that they are obligated to report any allegations of misconduct involving corpses. He promised swift investigations and "appropriate actions" against offenders.
The directive notes that "defiling, desecrating, mocking, photographing or filming for personal use insurgent dead constitutes a grave breach" of the armed-conflict laws. It also violates "basic standards of human decency, and can cause serious damage to relations with the Afghan government."
The directive is dated Thursday, one day after a video surfaced online showing four men equipped with what a Marine official described as sniper gear urinating on what appeared to be the bodies of three men on the ground.
One of the men says, "Have a great day, buddy." A voice asks, "You got it on the video?" to which another voice responds, "Yeah." Another jokes, "Golden, like a shower."
It was not clear who shot or posted the 39-second video or where, though a U.S. official said it was a "reasonable conclusion" it was filmed in Afghanistan.
Commanders have identified the four Marines who appear in the video, but those names have not yet been made public, said spokeswoman Maryann Cummings of the Naval Criminal Investigative Service (NCIS).
NCIS has talked to the Marines and all four are currently in the United States, she said. Investigators are still tracking down information on the person or people who created and posted the video.
The NCIS investigation, which was opened Wednesday, will report to Lt. Gen. Thomas D. Waldhauser, commander of the U.S. Marine Corps Forces Central Command. A separate administrative probe also will report to him.
The investigations are being structured to allow for possible courts martial of the Marines involved, as well as a broader administrative probe into issues surrounding the event, according to a Marine Corps official.
Those issues include whether commanders of the unit involved were aware of misconduct and whether a breakdown in discipline had occurred, the official said.
The Marine Corps confirmed Waldhauser's appointment in a statement, in which it also said it was confident "an expeditious, full and fair investigation will be conducted, and appropriate action will be taken in response to this incident."
While the identities of the people on the video haven't been released, the leadership of the 3rd Battalion 2nd Marine Regiment "is confident those are their Marines," according to a Marine official with direct knowledge of the initial investigation.
The official, based in Afghanistan, spoke on condition of anonymity because of the sensitivity of the issue.
The unit, based at Camp Lejeune, North Carolina, deployed in February or March and returned in September or October. While in Afghanistan, the unit was based primarily in Helmand province.
Officials in the United States and Afghanistan expressed shock and outrage over the video.
"I have seen the footage, and I find the behavior depicted in it utterly deplorable," U.S. Defense Secretary Leon Panetta said in a statement. "I condemn it in the strongest possible terms."
Marine Corps Commandant Gen. James Amos said that the behavior is "wholly inconsistent with the high standards of conduct and warrior ethos that we have demonstrated throughout our history."
President Barack Obama knows about the video, said White House spokesman Jay Carney. He said he didn't know whether Obama had viewed it.
"What it apparently depicts is deplorable, reprehensible and unacceptable," Carney said.
Afghan President Hamid Karzai called on the U.S. government to investigate and hand down the harshest punishment possible.
"This act by American soldiers is simply inhuman and condemnable in the strongest possible terms," the statement from Karzai's office said.
A Taliban spokesman called the video "barbaric."
"This inhuman act reveals their real face to the world," spokesman Qari Yousuf Ahmadi said via text message Thursday.
The video surfaces at a critical time for relations among the United States, the Afghan government and the Taliban.
Last year, the United States outlined its plan to withdraw its troops from Afghanistan, beginning by pulling out 33,000 "surge" troops who had been deployed to help quell the violence by the end of 2012. The remaining 68,000 troops would be withdrawn by the end of 2014.
Meanwhile, the Taliban tentatively agreed in recent weeks to open an office in Qatar's capital city of Doha, a decision widely seen as an overture aimed at establishing an outside forum for political talks with NATO-led forces and the current Afghan administration, among others.
CNN's Nick Paton Walsh, Masoud Popalzai, Barbara Starr and Tom Cohen contributed to this story.