Some members of the Afghan Parliament cast doubt on the US account that a single gunman was responsible for the killings, and they questioned whether the Army staff sergeant taken into custody would be held accountable for the worst atrocity by a US service member in the decadelong war.

“If the culprits are not punished, then people will be forced to take part in an uprising,’’ lawmaker Nazifa Zaki said.

The 38-year-old soldier, who was deployed with the Third Stryker Brigade from Joint Base Lewis-McChord in Washington state, turned himself in at his base in Khandahar Province. His name was not released because it would be “inappropriate’’ to do so before charges are filed, said Pentagon spokesman George Little.

Defense Secretary Leon E. Panetta said the US military would bring appropriate charges against the soldier, and the death penalty “could be a consideration.’’

The slayings were the latest in a cascade of missteps that have shaken Afghans’ confidence in the United States. And as ghastly details and images of the bodies were broadcast on Afghan television, even some Afghans with close ties to the United States said they feared that Sunday’s killings in the Panjwai district of Kandahar Province could come to mark an irreversible turning point.

“I am concerned like never before,’’ said Waheed Omer, the Afghan president’s former spokesman, who spent years arguing that the relationship between Kabul and its Western patrons was thorny but solid and essential. “It seems we only have bad choices to make. The lines between friends and enemies are blurred like never before.’’

“Afghan blood cannot be spilled in vain,’’ said Shukria Barakzai, a member of Parliament who heads the defense committee and has had strong relationships with Western officials. Barakzai said the suspect should be tried in an Afghan court or by an international tribunal, rather than in a US military court.

“We really need a proper, very official court for that guy,’’ she said. “We really, really need it.’’

The Taliban vowed to avenge the killings, which fit masterfully into its narrative depicting foreign troops as callous killers waging a war on Islam. In its statement, the militant group anticipated that the United States would seek to portray the killings as the acts of a deranged soldier.

“If the perpetrators of this massacre were in fact mentally ill, then this testifies to yet another moral transgression by the American military because they are arming lunatics in Afghanistan who turn their weapons against defenseless Afghans,’’ the Taliban statement said.

Calling the episode “tragic,’’ President Obama told a television interviewer Monday that the killings underscore the need to hand over responsibility for security to Afghans. But he said it will not lead to an early withdrawal of US troops.

“I think it’s important for us to make sure that we get out in a responsible way so that we don’t end up having to go back in,’’ Obama told Pittsburgh station KDKA. “It makes me more determined to make sure that we’re getting our troops home. It’s time.’’

Panetta, speaking to reporters on his plane en route to Kyrgyzstan, said the military was still struggling to understand a motive, but he called the killings “a criminal act.’’ He said he had assured President Hamid Karzai of Afghanistan that the soldier “will be brought to justice and be held accountable.’’

Obama and Panetta said the United States remained committed to the war and that the killings would not undermine the strategy or accelerate a planned drawdown of US troops over the next two years.

To deflate anger over the killings, US officials will have to act swiftly and sternly, said Davood Moradian, an assistant professor of political science at the American University of Afghanistan.

“There is a view here in Afghanistan that the US treats its soldiers differently, that there is a sense of impunity,’’ he said. “The US will need to show the Afghan people that it truly is a law-abiding nation.’’

Much will also depend on how successful the Taliban is in portraying the killings as a symptom of a doomed mission, rather than an aberration. The timing could hardly be more worrisome for the US military, which has lost hundreds of lives trying to restore Afghan control in the south and is now starting to thin out.

In the short term, the most immediate fallout could be the effect on Washington’s ability to negotiate a strategic-partnership agreement that would allow the United States to maintain troops here beyond 2014. In Iraq last year, a similar debate over accountability for civilian deaths ultimately doomed Washington’s goal of keeping a small contingent of US troops in the country.

The calls to prosecute the suspect in an Afghan court - a highly unlikely prospect because American troops have immunity from prosecution in Afghanistan - echoed the debate about whether US service members should remain shielded from prosecution in Iraqi courts.

In Iraq, the government began curbing the authority of US troops as the American drawdown started in 2009, most notably by restricting their presence in urban areas. That stance was driven by a yearning for sovereignty after the violent years that followed the 2003 US-led occupation and by the widespread feeling among Iraqis that US troops killed civilians wantonly.

Similar forces are driving the Afghan government’s insistence that the United States halt night raids on homes of suspected insurgents, an issue that is holding up the bilateral security-cooperation pact.

Last week the United States agreed to start transferring legal custody of its inmates in Afghanistan to the Kabul government, but it has ceded little additional ground as Afghanistan has sought to assert more control over the operations of coalition troops.

A Western official in Kabul, who spoke on the condition of anonymity to offer his assessment, said he was hopeful that the anger over the shooting rampage could be overcome.

The burning of Korans by US troops on Feb. 20 - which American officials said was accidental - unleashed a wave of violent protests and prompted Afghan security forces to open fire on US military trainers, but the fury subsided after a few days.

“Everyone said the burning of the Korans was a turning point,’’ he said. “It came and it went. My best analysis is that everyone saw the abyss and no one wanted to jump in.’’

Barakzai, the lawmaker, was far less optimistic. Although she expressed worry about the turn the country could take if the foreign troop withdrawal accelerated, Barakzai said the relationship between Afghanistan and the United States is nearing a breaking point.

“If things keep going in this direction, we are really at the end of the road,’’ she said. “The trust between our governments is trashed on both sides.’’