Updated

A man who confessed to shooting two soldiers outside a military recruiting station in Arkansas struck a plea deal with prosecutors Monday to avoid the death penalty.

Abdulhakim Muhammad pleaded guilty in the middle of his trial to capital murder and attempted capital murder charges. Pulaski County Judge Herbert Wright then sentenced Muhammad to life in prison without parole for capital murder, with 11 more life sentences for the remaining charges against him plus an additional 180 years in prison.

But prosecutors had to withdraw the death penalty for Muhammad to plead guilty to capital murder. Arkansas law requires a defendant to be tried if lethal injection is a sentencing option.

Muhammad had tried to plead guilty to capital murder during pre-trial proceedings, but he couldn't do that with prosecutors seeking the death penalty.

Muhammad was charged with the killing of Army Pvt. William Andrew Long. He also was charged with attempted capital murder for wounding Pvt. Quinton Ezeagwula in 2009.

He confessed to the shootings in phone calls to The Associated Press, and also admitted his deeds to the judge overseeing his case and to authorities. Muhammad said he was acting in retribution for the deaths of Muslims in U.S. military action in Iraq and Afghanistan.

Ezeagwula's mother, Sonja Ezeagwula, testified Monday afternoon shortly after Muhammad pleaded guilty.

"I want you to feel the bullet in his head," she said.

She looked at Muhammad's family, who filed into the courtroom after he pleaded guilty.

"I am so sorry for the choice that your son decided to make," she said.

Muhammad and investigators said he drove up to a military recruiting station in Little Rock in 2009, where two soldiers -- Long, 23, and Ezeagwula, then 18 -- were smoking cigarettes outside. They'd recently completed basic training and had volunteered to work as recruiters.

Neither had seen combat. Muhammad fired an assault rifle, killing Long and wounding Ezeagwula.

Police stopped Muhammad moments later on a highway that would have taken him to Memphis, Tenn., where he lived until he moved to Little Rock. Officers found more weapons and ammunition in his truck, along with a stash of bottled water and food. He told authorities he would have killed more soldiers if he could have.

Muhammad and those prosecuting him say he knew what he was doing, but his defense attorneys and father say something's clearly wrong. His lawyers argued that he was not guilty by reason of mental defect, and a defense psychiatrist testified Muhammad was delusional.

"Anyone who watches him speak or reads those letters that he's been writing knows that something is not right in his head," said his father, Melvin Bledsoe of Memphis.

Muhammad was born Carlos Bledsoe but changed his name after converting to Islam during college.

In 2007, he traveled to Yemen, where Islamic extremists are known to seek sanctuary. He overstayed his visa and was deported back to the U.S.

Muhammad claimed to have links to terror groups, but it's unclear whether that is true.