NEW YORK – A man accused in the horrific abduction and dismemberment of an 8-year-old boy from a tight-knit Orthodox Jewish community pleaded guilty on Thursday -- a deal that will put him behind bars for at least 40 years and avoid a heart-wrenching trial.

Brooklyn District Attorney Charles Hynes made the arrangement in close consultation with the family of the boy, Leiby Kletzky.

The plea, to charges of second-degree murder and kidnapping, guarantees a sentence of 40 years to life for Levi Aron, a 36-year-old hardware store clerk. He originally had faced a first-degree murder charge.

The family was "eager to see this concluded and grateful to D.A. Hynes," Assemblyman Dov Hikind, who's acted as a family spokesman, said in a statement before the plea. "The last thing they want is to relive the horror of losing their child."

One of the city's most gruesome crimes in recent memory began with a chance encounter last summer on the streets of Borough Park, home to one of the world's largest Hasidic communities outside Israel.

The victim got lost on his walk home from a religious day camp and asked Aron, whom he met on the street, for help, prosecutors said. It was the first time the little boy was allowed to walk alone, and he was supposed to travel about seven blocks to meet his mother but missed a turn.

According to court papers, the defendant himself provided authorities a disturbing narrative of what happened next.

During an interrogation after his arrest and in a written confession, Aron recounted how the boy first asked for a ride to a book store. But "on the way, he changed his mind and wasn't sure he wanted to go."

The defendant described deciding to take the boy to a wedding upstate. He said when they returned, they watched television before the boy fell asleep. Leiby remained there the next day while Aron went to work.

By that time, the disappearance had sparked a major search effort in Borough Park. The boy's picture was plastered on light posts around the area.

"When I saw the fliers, I was panicky and afraid," police said Aron wrote. Once home, he added: "I went for a towel to smother him. He fought back a little until he eventually stopped breathing."

The medical examiner's office said that before the boy's death he was given a cocktail of prescription drugs.

Detectives' notes also outlined statements by Aron about how he carved up the body with knives and disposed of body parts, including the severed feet found wrapped in plastic his freezer. A cutting board and three bloody carving knives were found in the refrigerator.

The rest of the boy's body was discovered in bags inside a red suitcase in a trash bin. His legs had been cut from his torso.

Aron claimed that after the killing he was hearing voices telling him "to take his own life for what he did," according to court papers.

As the interrogation wore on, detectives said Aron made clear he was aware of his own notoriety.