Updated

The man accused of kidnapping two children from their Idaho home and killing their family pleaded guilty Monday to murder and kidnapping in a deal that spares his youngest victim from testifying at trial.

Joseph E. Duncan III, 43, was charged with bludgeoning two adults and a teenager to death at the home near Coeur d'Alene so he could kidnap the family's two youngest children for sex.

The young boy was later found dead at a Montana campsite. Only 9-year-old Shasta Groene, rescued after Duncan walked into a Idaho restaurant with her seven weeks later, survived. She was expected to be a primary witness against Duncan at trial.

Click here to visit FOXNews.com's Crime center.

Duncan pleaded guilty shortly before his trial was to being Monday to three counts of first-degree murder in the deadly hammer attack on Shasta's mother, Brenda Groene; Groene's fiance, Mark McKenzie; and Groene's 13-year-old son, Slade, in May 2005.

Under his plea agreement, he is to be sentenced to three consecutive life terms without parole in Idaho.

That sentencing was delayed pending federal prosecution that could result in the death penalty, Kootenai County Prosecutor Bill Douglas said.

"We essentially gave up nothing," Douglas said. "It is virtually guaranteed he will face two death juries."

The agreement calls for Duncan to cooperate fully with law enforcement officers on the state charges and the anticipated federal charges in the kidnapping of the two children and the killing of Dylan in Montana.