SPARTANBURG — A 19-year-old man will spend 25 years in prison after admitting he shot and killed his cousin and initially trying to convince investigators it was a suicide.

David Boggs III pleaded guilty but mentally ill to voluntary manslaughter Monday. He faced up to 30 years behind bars.

The Herald-Journal of Spartanburg reports that Boggs’ lawyer said Boggs killed 33-year-old Eddie Richards in February 2015 after years of Richards trading money and drugs for sexual favors.

Prosecutors called that defense a sham and said the two agreed to the relationship.

Authorities say Boggs told investigators at the time of the shooting it was a suicide, but changed his story when confronted with the evidence.

Boggs and Richards became cousins by marriage, and neither had a criminal record before the shooting.