For eight months, Kevin Fox sat in a jail cell as a suspect in his 3-year-old daughter's death, knowing prosecutors wanted him executed and that the real killer was free.

On Wednesday, Fox sat just a few feet away from Scott Eby as the convicted sex offender pleaded guilty to the suburban Chicago girl's sexual assault and murder. In a clear voice, Eby said the word "guilty" six times — ensuring he will spend the rest of his life behind bars for the death of Riley Fox.

In exchange for the 39-year-old's plea, prosecutors agreed not to seek the death penalty.

The courtroom was packed with dozens of friends and family of Riley, many wearing pins with a photograph of the girl nicknamed "Rileybugs" on them. The gallery was silent as Eby entered his plea, ending a six-year ordeal in the highly-publicized case.

Kevin Fox, who was exonerated by DNA evidence, was the first to take the witness stand and read a statement in which he talked about his time in jail.

"I would always wonder what you were doing with your freedom," he said. "If you were lying, watching TV or if you were picking your next victim."

He said that once he left court, he would drive Eby from his mind.

"After today you will no longer be a part of my memories of my daughter," he said looking up from his notes, staring directly at Eby.

In horrific details, Assistant Will County State's Attorney Michael Fitzgerald told the judge how Eby, in a five-page letter, admitted that on June 6, 2004, he had been drinking and using cocaine — a combination that gave him the urge to break into Riley's Wilmington house and molest her.

Eby said he put a bandanna over his face before entering the house, put his hand over Riley's mouth and put her in the trunk of his car. He described then driving to a nearby forest preserve, duct-taping her wrists and mouth and sexually assaulting her on the floor of a men's room.

"Eby wrote that it was stifling hot that day, that he must have pulled down his bandanna because he looked down and stated that Riley Fox was staring at his face," Fitzgerald said.

Eby told authorities he knew the girl could identify him and panicked, taking her to a nearby creek and holding her "under the water by the shoulders until he couldn't feel her struggle anymore."

Many in the courtroom openly wept.

Melissa Fox spoke of the joys of watching her daughter and how she liked to sing, dance, tell jokes and catch butterflies. But, as her voice cracked, she also told Eby what he took when he held her daughter's head under water. Tears welled in Eby's eyes as the girl's mother spoke.

"She would never have the opportunity to play with her friends, have sleepovers, get her driver's license, go to homecoming or prom, go to college, get married or have a family of her own," Fox said. "I didn't get a chance to say goodbye or give her a last kiss or hug. Instead, I visit a headstone that I decorate for holidays and her birthday."

Eby spoke briefly, saying he didn't know why he killed the little girl.

"I wish I could explain," he said reading from a piece of lined notebook paper his attorney said he wrote himself.

After the hearing, Eby's attorney, Michael Renzi, said his client planned on pleading guilty from the time he was charged in May. He said Eby didn't want to put the family through a trial.

Prosecutors said Riley's parents agreed to the plea deal.

"I'm opposed to you getting the death penalty and dying a quick, painless death," Melissa Fox told him.

Kevin Fox had harsher words after the trial.

"I hope he rots in hell," he told reporters.

The plea comes nearly five months after Will County State's Attorney James Glasgow announced he'd charged Eby with first-degree murder and predatory criminal sexual assault of a child.

Authorities were led to Eby from DNA evidence collected from the crime scene along with other clues, including a pair of Eby's shoes pulled from the water that had his name written in them.

Glasgow, who was not the prosecutor when Kevin Fox was arrested, cleared him after taking office. Fox and his wife were awarded $12.2 million in damages after they accused Will County investigators of fabricating evidence. A federal appeals court in April reduced the award to $8.6 million.

Eby was an inmate at the medium security Lawrence Correctional Center in Sumner, serving time for a Dec. 2005 sexual assault conviction filed in an attack on a relative. According to the Illinois Department of Corrections, he will be eligible for parole on that conviction in mid-2017.