WALKER, MINN. – A friend of Alayna Ertl's family was charged Tuesday with abducting the 5-year-old from her home in Watkins, Minn., sexually assaulting the girl and killing her before leaving her body 80 miles to the north in a swampy area of central Minnesota.

Zachary T. Anderson, 25, who has lived in Monticello and, most recently, Coon Rapids, was charged in Cass County District Court with second-degree murder, first-degree criminal sexual conduct, kidnapping and theft of a motor vehicle.

In Watkins, population 1,000, nearly 1,000 people attended a vigil for Alayna on Tuesday evening. Holding candles, they gathered under the stately tower of the Church of St. Anthony across the street from the Ertls' house. On a video screen, a larger-than-life image of the sandy-haired girl in a flowery headband looked out over the crowd.

The charges say that Anderson strangled the girl, struck her in the head and sexually assaulted her. The pink Princess Elsa blanket that Alayna routinely slept with was found near her unclothed body, left submerged in water on property owned by Anderson's family, the criminal complaint said.

When law enforcement encountered Anderson on the land Saturday afternoon, he was standing knee-high in the swamp, his left wrist cut, the charging document read. A bloodstained suicide note was found on a table in the cabin, along with a shotgun and ammunition, the complaint added.

Anderson, who has been jailed since Saturday, appeared before District Judge David Harrington in Walker late Tuesday morning. The court granted him a public defender.

A stocky man with a heavy mustache, Anderson was dressed in orange jail garb and shackled at the wrists and ankles as he entered the courtroom with an audience of about a dozen. He sat quietly, speaking only to answer a few questions from Harrington.

A vigil for Alayna

Many parents brought their children to the Watkins church for Tuesday night's vigil, which began with prayers, Bible readings and songs led by Rev. Aaron Nett. The video screen at the front of the crowd lit up with photos, starting with Alayna's birth just five years ago. Then came wide-eyed toddler photos, and the girl's first Halloween pumpkin, first ice cream cone and first Christmas. The words "Forever in our hearts" then appeared, amid sobs from many in the crowd.

Dozens of children released pastel balloons. Alayna's parents, Matt and Kayla, were the first to light their candles, and soon a thousand small flames flickered in the church parking lot.

Nicole Olmscheid and David Mattson brought their daughter, Sadie, 1½, from Eden Valley. Alayna's death "really touched home now that we have our own daughter," Olmscheid said.

Rebecca Reiter, came with her two daughters, 9 and 17. "This doesn't even happen in the big city, much less in a small town," she said.

Bail was set at $2 million without conditions or $1 million with conditions, which include not being able to leave the state or have any contact with the Ertl family or their property. Anderson is due back in court on Oct. 10.

An attorney for the state asked for bail of up to $3 million, pointing to forensic evidence that Alayna was sexually assaulted and that authorities found her body in the water and hidden by debris.

An attorney for Anderson countered that his client has no criminal record before this case and has lived in Minnesota his entire life.

The criminal complaint and police accounts reveal what started as an uneventful early Saturday morning in the Ertls' home, followed by the realization that their daughter was gone and the connecting of dots that led investigators to Anderson and, ultimately, Alayna.

According to the complaint:

Matt Ertl arrived home about 2:30 a.m. after a night of softball and socializing. About that time, Alayna's mother, Kayla, carried her sleeping daughter from the couch to the girl's bedroom. Anderson, who worked with Matt Ertl and also played softball with him, showed up an hour or so later. Anderson would occasionally stay over with the family after games. Soon after Anderson arrived at the house, Matt Ertl went to bed.

About 8:30 a.m., the Ertls realized Alayna was gone. Anderson and the family's pickup also were missing. By 10 a.m., the Sheriff's Office and state Bureau of Criminal Apprehension (BCA) had been called and the search was on.

Anderson's father, after learning of the Amber Alert issued about 1:10 p.m. that mentioned his son and Alayna, contacted the Cass County Sheriff's Office about a half hour later and said his son had called earlier asking permission to visit the family cabin near Motley.

Two Cass County sheriff's deputies went to the property, and one saw the Ertls' pickup, apparently hidden in a ravine.

Inside the cabin, deputies found a shotgun, ammunition and "an apparent suicide note with apparent blood on the upper corner" on the kitchen table, the court filing read.

But there was no sign of Anderson or the girl.

Three deputies and a dog searched the woods nearby. Shortly before 4:30 p.m., they discovered Anderson about a quarter-mile from the cabin and knee-deep in swamp water, with cuts to one wrist. When asked about "the girl," he responded, "What girl?"

Soon after his arrest, Anderson told BCA investigators that Alayna was in the swamp beneath some debris. "Over there," he said, pointing to the swamp's edge a few hundred yards from the cabin.

One investigator tugged on a piece of cloth, revealing Alayna's blanket from the Disney movie "Frozen." Officers found her body "completely submerged in the water and hidden under some brush and other debris," the charges read.

An autopsy performed in the Twin Cities ruled that Alayna died from strangulation and also suffered blows to the head. The examination also confirmed the sexual assault.

Before being implicated in Alayna's death, Anderson's criminal history as an adult appears limited to minor traffic violations and a handful of calls in Wright County for other matters, including an assault in April 2014 and four incidents involving domestic disturbance, the Sheriff's Office in that county said Tuesday. None of those calls resulted in arrests or charges.

Dawn Hegenbarth-Nolte, Anderson's mother, declined this week to comment on the case or her son's arrest.

Alayna's obituary online read: "Alayna gave joy to our lives by always having a smile. She was an animal lover, a princess, a singer, a great friend to everyone she met, and was our peanut. She loved learning from her brother, and always gave the best hugs."

A funeral has been scheduled for 10:30 a.m. Friday at the church. Burial will follow at the church cemetery. There are two visitation times: Thursday from 4 to 8 p.m. and Friday from 9 to 10 a.m. at the Ertl Funeral Home in Watkins.

Along with parents Matt and Kayla, Alayna is survived by her brother, Carter.

A fundraising effort on gofundme.com has received more than $49,000 in pledges to help the family with expenses related to Alayna's death.

Staff writer Pat Pheifer contributed to this report.

pwalsh@startribune.com 612-673-4482

emma.nelson@startribune.com 612-673-4509