Prosecutors say 24-year-old Ramon Hernandez also pleaded guilty Wednesday to attempted home invasion robbery and residential burglary.
Prosecutors say Hernandez and two other Marines based at Camp Pendleton killed David Pettigrew in September 2007 while they were retrieving a laptop they had given to him for cocaine that was not delivered.
The other defendants, Trevor Landers and Anthony Vigeant, are also charged with murder. Prosecutors say Hernandez wants to testify against them at their trials.
Hernandez earned a Purple Heart as a corporal after sustaining a significant head injury during the Iraq war.
It was not clear if the defendants remain Marines.