Mohammed and two accomplices agreed to plead guilty in exchange for sentences of up to life in prison rather than face a death-penalty trial.