A military judge granted a Marine corporal's request Thursday to withdraw his guilty plea to charges of murdering an unarmed Iraqi civilian who was dragged from his home and shot.

Cpl. Trent Thomas asked to change the plea, saying he no longer believes he is guilty. Thomas now says he believes he was following a lawful order from his superiors.

"Sir, when my country gives me an order, I follow it," Thomas told the judge, Lt. Col. Tracy Daley.

Thomas, 25, pleaded guilty Jan. 18 to eight felonies including kidnapping, murder and assault. He was one of a squad of seven Marines and a sailor accused last year of hatching a plot to kill an Iraqi in the town of Hamdania. Four others pleaded guilty to lesser charges. Thomas, the squad's second in command, could face life in prison.

Outside court, Kelley said Thomas had an "epiphany" Wednesday night and decided to withdraw his pleas. "Corporal Thomas has always wanted to fight it," Kelley said of the charges.

The request to withdraw the pleas came at the beginning of the second day of Thomas' sentencing hearing.

On Wednesday, the Navy medic, who said he was one of Thomas' closest friends, testified that the Marine corporal played an instrumental role in carrying out the kidnapping and murder.

Seaman Recruit Melson J. Bacos testified that Thomas, along with Cpl. Marshall Magincalda, entered the home of Hashim Ibrahim Awad's on April 26 while Bacos and Lance Cpl. Robert Pennington waited outside. Thomas and Magincalda returned with a confused-looking Awad, Bacos said, then the troops started walking him away from the house.

For much of that march, Thomas held onto Awad, Bacos said.

"He was grabbing him, pushing him forward," Bacos said. "If he was talking, he told him to shut up, be quiet."

Bacos said the squad forced Awad into a hole and shot him, then tried to cover it up by placing an AK-47 and shovel by his body to make it look like he was an insurgent planting a bomb.

Prosecutors — as well as other squad members who made plea deals — have said the troops wanted to kill an Iraqi insurgent they suspected of planting bombs. They couldn't find the man, and instead kidnapped Awad, according to court testimony.

Bacos, testifying about 12 feet from where Thomas sat, did not make eye contact with his friend, whom he met in 2004 and served with on an earlier Iraq combat tour. When a prosecutor asked Bacos whether it was difficult to testify about Thomas, he said, "It's not easy at all, sir."

Thomas' wife, Erica Thomas, said outside court Wednesday that her husband is a Christian and a good father to their 2-year-old daughter, and that he bears no anger toward his colleagues or the Marine Corps for prosecuting him.

"He's got no animosity toward anyone," Erica Thomas said. "He would re-enlist in the Marines if he could."