CODY, Wyo. — A Wyoming man who pleaded guilty to killing and dismembering a suspected drug dealer has been sentenced to 25 to 35 years in prison.

John Marquez, 53, pleaded guilty Tuesday to second-degree murder in the death of Juan Antonio Guerra-Torres.

Marquez admitted killing Guerra-Torres in late December 2013 north of Cody. His decapitated body, also missing his left arm and right hand, was found in January 2014. It took months to identify him.

Marquez testified he killed Guerra-Torres after longtime family friend Pedro Garcia Jr. told him the victim owed tens of thousands of dollars to dangerous drug dealers who were threatening the family including Garcia's sister and her children with Guerra-Torres.

"I know what I did was wrong, now I've got to suffer the consequences. But I was led to believe my son and my grandchildren were in danger and that Pedro Garcia's father and his mother (also were) and I did what I had to do," Marquez told the judge. "Would I do it again? No, I wouldn't. I wouldn't even think of doing something stupid like that again."

Defense attorney Devon Petersen said his client made a terrible choice.

"He never would have done this had he not been incited to and played upon his fears of his family's safety," Petersen said.

Marquez has convictions for child abuse and marijuana possession. He twice violated the terms of his release from prison in the marijuana case, the first time by using cocaine and traveling to Mexico without permission, court records said. He served additional prison time for both violations.

Garcia Jr., 30, faces 25 to 40 years in prison after pleading guilty to aiding and abetting second-degree. His sister, Sandra Garcia, 29, is serving 10 to 18 years for aiding and abetting manslaughter and being an accessory after the fact to second-degree murder.

Park County Sheriff Scott Steward said it was a "twisting case" from the beginning and that the defendants' account of what happened changed every day. He said he was satisfied that all three people involved were prosecuted without having to go to trial.