(Reuters) - Defense Secretary Leon Panetta said Monday that the death penalty could be sought over the massacre of 16 villagers in Afghanistan, which U.S. officials said they believe was the work of a rogue American soldier.

The shooting spree in the southern province of Kandahar, which killed mostly women and children, has triggered angry calls from Afghans for an immediate American exit from the country, as Washington tries to negotiate a long-term presence to keep it from sliding into chaos again.

President Barack Obama, in an interview with KDKA in Pittsburgh Monday, said the incident makes me more determined to make sure we're getting our troops home. It's time. It's been a decade, and, frankly, now that we've gotten bin Laden, now that we've weakened al Qaeda, we're in a stronger position to transition than we would have been two or three years ago.

Panetta attempted to portray the shooting as an isolated event that would not alter plans for a gradual, orderly withdrawal of American combat forces by the end of 2014.

War is hell. These kinds of events and incidents are going to take place, they've taken place in any war. They're terrible events. And this is not the first of those events, and it probably won't be the last, the defense secretary told reporters on a flight to Kyrgyzstan.

But we cannot allow these events to undermine our strategy or the mission that we're involved in.

Panetta, answering questions for the first time about the shooting rampage, said U.S. officials were still uncertain about the motives behind it.

He said the goal was to try the case within the U.S. military justice system. Asked whether the death penalty could be considered in this case, Panetta replied: My understanding is that in these instances that could be a consideration.

Panetta said of the soldier, whose name has not been made public: He went out in the early morning and went to these homes and fired on these families. And then at some point after that, came back to the forward operating base and basically turned himself in, told individuals what had happened. These were the preliminary findings of the investigation, he said.

Asked whether the soldier in fact confessed, Panetta said: I suspect that that was the case.

While U.S. officials rushed to draw a line between the rogue shooting and the ongoing efforts of a U.S. force of around 90,000, the incident has infuriated Afghans already suspicious of a Western military presence now over a decade old.

Last month, the burning of copies of the Koran on a NATO military base triggered violent protests across the country and a spate of insider attacks against Western soldiers.

The string of incidents, which also included release of a video of Marines urinating on the corpses of Taliban fighters, appear to have raised questions about the U.S. strategy of training Afghan security forces to take over as NATO troops depart.

But Panetta said, 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.

(Editing by Warren Strobel and Paul Simao)