Former Oklahoma death row prisoner Richard Glossip, who spent nearly 30 years incarcerated and was on the brink of execution three times for a 1997 murder, pleaded guilty to a lesser charge, his attorney said Thursday.

Glossip had been sentenced to death over the killing in Oklahoma City of his former boss, motel owner Barry Van Treese.

Van Treese was beaten with a baseball bat in what prosecutors have alleged was a murder-for-hire scheme.