Murder suspect Zachary Todd Anderson pleaded guilty Friday to the 2016 rape and slaying of Alayna Ertl, 5, and was immediately sentenced to life in prison without parole.

The sudden end to the prosecution of Anderson, 27, of Monticello, came about when his attorneys signaled that he would admit to the heinous crime, said Cass County prosecutor Ben Lindstrom.

"This is a case where we weren't going to make a compromise," said Lindstrom, who was preparing to argue for a life sentence for Anderson in a trial scheduled for April.

On Aug. 20, 2016, Alayna was taken from her Watkins home in Minnesota's Meeker County and found dead later that day on property the Anderson family owned near Motley, about 80 miles to the north in rural Cass County.

She was last seen when she was put to bed at 2 a.m. that Saturday. Her mother, Kayla Ertl, discovered her missing about 8 o'clock the following morning. Anderson, a co-worker of Alayna's father, Matt, who had been staying at the Ertl home, was also gone, along with the family's GMC Sierra pickup truck.

According to the indictment, Anderson and Matt Ertl played softball together and then went out with friends before returning late to the Ertl home. They stayed up talking until 4 a.m. before Matt Ertl went to bed.

The family notified authorities about 8:30 a.m. that their daughter was missing.

An Amber Alert was issued at 11:15 a.m. that included Anderson's name and a description of the stolen truck.

Anderson's father contacted the Cass County Sheriff's Office at 2 p.m., saying he had learned of the Amber Alert and told authorities that Zachary had called him earlier that day to ask permission to use the family's cabin in Motley.

Two Cass County sheriff's deputies went to the cabin and found the missing pickup in a nearby ravine. It was unoccupied. The deputies broke into the cabin, searching for Alayna, but no one was there.

They found a shotgun, shells and a bloody suicide note. A tracking dog from the Cass County Sheriff's Office joined the investigation, and at 4:20 p.m. they found Anderson knee-deep swamp water.

After initially denying any knowledge of the girl's whereabouts, Anderson told authorities that Alayna was in the swamp.

An investigator found Alayna's pink blanket first, and then found her body completely underwater and hidden by brush and debris.

An autopsy found evidence of strangulation and blunt force trauma to the girl's head.

A grand jury issued a 19-count indictment against Anderson in October, 2016.

Anderson's plea means that he will not face trial. Some of the other charges on his indictment, including kidnapping, will be dismissed. Lindstrom said there's no point in dragging the Ertl family through a three- to four-week trial now that Anderson has been sentenced to the maximum sentence allowed under state law.

At Friday's sentencing hearing in Walker, Minn., before Cass County District Court Judge Jana Austad, several Ertl family members gave victim impact statements describing their loss.

Matt Ertl, contacted at his home Friday, said he and his wife had nothing else to say for now.

The trial likely would have included graphic descriptions of Anderson's crime, something no one wanted to put the Ertl family through, said Lindstrom.

"It's never going to be over for them because they don't have Alayna anymore," Lindstrom said.