Military officials said they feared the photographs -- which included soldiers posing next to the mangled body of a suicide bomber hoisted by his ankles -- could incite violence.
Once the newspaper decided it would publish "the least gruesome" two of 18 images it received, military officials asked, and Times editors agreed, to wait for extra security precautions to be put in place in Afghanistan, the newspaper said.
The Times waited more than 72 hours.
U.S. Defense Secretary Leon Panetta Wednesday "strongly condemned" the actions of the troops, seen smiling with the dead insurgents.
"Those individuals will be held accountable," he told reporters in Brussels, where NATO ministers were meeting to discuss the war's progress.
"This is war. And I know that war is ugly and it's violent," he said. "And I know that young people sometimes caught up in the moment make some very foolish decisions.
"I'm not excusing that behavior," he said.
"But neither do I want these images to bring further injury to our people or to our relationship with the Afghan people," Panetta said. "We had urged the LA Times not to run those photos, and the reason for that is those kinds of photos are used by the enemy to incite violence, and lives have been lost as a result of the publication of similar photos in the past, so we regret that they were published. But having said that, again, that behavior is unacceptable, and it will be fully investigated."
The Times said it ultimately decided to publish the photos because it considered them newsworthy, even though they were two years old.
The 18 photographs it received from an unidentified U.S. soldier were taken in 2010 in Zabul province by soldiers from the 82nd Airborne 4th Brigade Combat Team, the newspaper reported.
"We considered this very carefully," editor Davan Maharaj said in a Web chat with readers.
"At the end of the day, our job is to publish information that our readers need to make informed decisions," he said. "We have a particular duty to report vigorously and impartially on all aspects of the American mission in Afghanistan.
"On balance, in this case, we felt that the public interest here was served by publishing a limited, but representative sample of these photos, along with a story explaining the circumstances under which they were taken."
Virtually all the men depicted in the photos had friends killed or wounded by homemade bombs or suicide attacks, the soldier who provided the images told the newspaper.
"They were frustrated, just pissed off -- their buddies had been blown up by IEDs," or improvised explosive devices, the soldier said. "So they sort of just celebrated."
In January, a video appeared on the Internet showing four U.S. Marines laughing as they urinated on Afghan corpses. In February, the inadvertent burning of copies of the Koran at a U.S. base triggered riots that left 30 dead and led to the deaths of six Americans. In March, a U.S. Army sergeant went on a nighttime shooting rampage in two Afghan villages, killing 17 people, mostly women and children.
Texas principal bans speaking Spanish, stirs controversy
Toddler uninjured after being knocked over by Obama family dog