The suspect, who has been arrested, went on a killing spree over the weekend, shooting down civilians, most of them women and children, in an act that has taken anti-America sentiment to a new high in Afghanistan.
According to Fox news, Panetta told reporters travelling with him to Kyrgyzstan that the suspect may face "capital charges", but the US must resist pressure to change course in Afghanistan because of anti-America outrage over the shooting.
The suspect, whose name has not been released by the Pentagon so far, is from a military base in Washington State -- some soldiers from where have had similar violent histories in the past, reports said.
"War is hell," Panetta said, but insisted that the incident is not a sign that stress of 10 years of war was pushing US troops to a breaking point.
"We seem to get tested almost every other day with challenges that test our leadership and our commitment to the mission that we're involved in," Panetta said.
The suspect, 38, suffered traumatic brain injury in 2010 after a vehicle rollover accident in Iraq, though he later was deemed "fit for duty".
Panetta said the suspect had "family problems," possibly related to trouble in his marriage, before deploying for the fourth time.
"I think when you look at that larger picture, it does make clear that these kinds of events are isolated and don't represent what's really happening in Afghanistan," he was quoted as saying by the military Star and Stripes newspaper.