Ruben Rocha Castro will spend the next 25 years to life in prison after being sentenced on Friday at the downtown Bakersfield courthouse.
Castro was found guilty in May of first degree murder after he strangled Andrea Russell, who was a prostitute, in a Bakersfield motel in 2014.
Castro then messaged a friend to help him dump the body. The body was later found by police in an abandoned house.
The defense argued that Castro was acting in self-defense but the messages hurt his case.
Castro has served a little over two years in prison.