RIVERTON, Wyo. (AP) — A 25-year-old Wyoming man has pleaded guilty to second-degree murder in the 2014 stabbing death of another man in bed with his estranged wife.

Jeremiah Shull, of Riverton, entered the plea Monday, negating the need for a second trial after the Wyoming Supreme Court had overturned his first conviction in February because of flawed jury instructions.

Shull's second trial had been scheduled for Aug. 7.

Prosecutors say Shull stabbed and slit the throat of Jacob Willenbrecht as Willenbrecht slept in bed with Julie Cordell-Shull on Oct. 19, 2014.

In a statement to the court, Shull said he had gone to his wife's house not with any ill intent, but in a last attempt to save his marriage.

Shull remains in the State Penitentiary pending sentencing.