KENANSVILLE, N.C. (AP) — A Beulaville man has pleaded guilty to the shooting death to a man who prosecutors say was having an affair with his wife..

Local media outlets report Max Turner entered the plea after three days of jury selection in his trial.

Turner was charged in the shooting death of Jamie Fountain in 2013. At the time, police said Turner found his wife with Fountain in the back seat of an SUV in the parking lot of a florist shop in Kenansville. Authorities say that’s when Turner shot and killed Fountain.

Fountain was sentenced to at least 17 years in prison and will have to undergo a mental health evaluation.

Turner’s plea was entered on Wednesday.