GREENVILLE — A man has been sentenced to life in prison in the shooting death of a son who rushed into a store, which the suspect was robbing, to protect his mother.

Prosecutors said 24-year-old Tremain Davis pleaded guilty to murder Tuesday, ending his trial. He faced 30 years to life in prison, and the judge handed down the maximum sentence.

Investigators said Davis went inside a Dollar General store in Greenville in April 2010 to rob it.

Authorities said 26-year-old Joshua Bryant was in the parking lot and saw Davis go inside with a gun. Prosecutors said Bryant went in to protect his mother, who was shopping, and was shot in the neck by Davis as he tried to stop the robbery.