An American soldier who is suspected of killing 16 Afghan civilians in a shooting rampage was flown out of Afghanistan on Wednesday and is likely to face legal proceedings back in the United States, Pentagon officials said.

Capt. John Kirby, a Pentagon spokesman, said the soldier was moved “based on a legal recommendation” to a pretrial detention center, but he declined to say where. The unidentified staff sergeant has not been charged, but U.S. officials said he surrendered after the killings and admitted his involvement.

The soldier’s unit is from Joint Base Lewis-McChord, near Tacoma, Wash., and it is likely that he would face prosecution there if he is charged. A decision on whether to press charges or convene a court-martial would be made by an Army general in the soldier’s chain of command.

The U.S. military has kept the name and motivation of the suspected spree shooter a closely held secret since Sunday, when he allegedly walked off a small combat outpost in Kandahar province in the pre-dawn hours and gunned down 16 Afghans, most of them women and children.

Some Afghan lawmakers have demanded that the soldier be tried publicly in their country to reassure Afghans that justice is being served. Kirby said the U.S. military had not ruled out sending the soldier back to Afghanistan for trial, but other officials said that was highly unlikely.

President Obama, Defense Secretary Leon E. Panetta and other U.S. officials have sought to tamp down Afghan anger over the massacre by promising a thorough investigation and accountability for the shooter. Panetta has said the soldier could face the death penalty.

Some Afghans who survived the massacre have questioned the official U.S. account that a single person was responsible for the shootings, saying they saw other U.S. troops in the village.

To dispel those rumors, U.S. officials have shown a base surveillance video of the staff sergeant surrendering to Afghan security guards in an effort to prove that he was a lone gunman and to knock down rumors that other American troops might have been involved, a U.S. official said.

The surveillance video was recorded from a spy balloon floating over the combat outpost, known as Camp Belambi.

At a White House news conference with British Prime Minister David Cameron, Obama called the shootings “tragic” but said the incident had not deterred NATO from its plans to gradually withdraw all combat troops from Afghanistan by the end of 2014.

“In terms of pace, I don’t anticipate at this stage that we’re going to be making any sudden additional changes to the plan that we currently have,” Obama said.

Jaffe reported from Camp Leatherneck, Afghanistan.