Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The 21-year-old man accused of kidnapping Wisconsin girl Jayme Closs and killing her parents revealed that he targeted the 13-year-old after spotting her at a local bus stop and deciding at that moment he would kidnap her, authorities said.

Jake Patterson, of Gordon, Wisconsin, was formally charged with two counts of intentional homicide and one count each of kidnapping and armed burglary, according to a criminal complaint filed with the Barron County Clerk of Courts office.

Patterson allegedly broke into the Closs home in Barron, Wisconsin, on Oct. 15, killed Jayme's father, James Closs, 56, and mother, Denise Closs, 46, with a shotgun, and left taking Jayme with him, authorities said.

The 13-year-old wasn't seen again until she emerged Thursday from woods in Douglas County, about 80 miles from her home, and approached a woman who had been out walking her dog.

One of the mysteries of the case has been how Patterson came to target Jayme and her family.

It turns out that he saw her get on a school bus that he was driving behind on a local highway, according to court documents.

Patterson was read his Miranda rights before giving a lengthy, interview to Barron County Sheriff's Det. Jeff Nelson and Special Agent Joe Welsch

Patterson "had no idea who she was" at the time, Barron County District Attorney Brian Wright wrote in the complaint, citing the defendant's statements. He "stated when he saw [Jayme] he knew that was the girl he was going to take," the complaint said.

The random sighting came during one of the two days when Patterson was working for a nearby cheese factory, authorities said. Patterson worked for that company on Oct. 3 and 4, a representative told NBC News. That was less than two weeks before the kidnapping.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

He cased the family house twice, before he killed the parents and took Jayme on Oct. 15, Patterson allegedly told investigators.

The suspect told detectives of his meticulous planning of the crime, including his wiping his fingerprints of shell casings, buying a black balaclava from Walmart and shaving his face and head so as not leave any DNA at the crime scene. He also said he stole license plates to put on his car and removed the light inside his car trunk so Jayme wouldn’t see a cord in the trunk that she could have pulled to open it, the complaint said.

“The defendant stated he never would have been caught if he would have planned everything perfectly,” Wright wrote.

Jayme was the first in the family to see Patterson approaching the house, as she was awakened by the family's barking dog, the complaint states.

The teen "got up to investigate why her dog was barking and noticed there was someone driving up their driveway," then woke her parents, the complaint said.

The complaint painted a grim scene of what deputies found when they arrived at the Closs home on Oct. 15 in response to a 911 call from the house.

The father's body was found near front door, according to Wright. "He had significant trauma to his face and head."

James Closs had met Patterson at the door, and the defendant ordered him to the ground, prosecutors said.

“The defendant stated James made some comment like, show me your badge, and assumed James thought he was police," according to the complaint.

Patterson told authorities he then shot James Closs dead.

The mother and daughter had been hiding in the bathtub behind a shower curtain when Patterson kicked in the door to find them, according to the complaint. Denise Closs had her arms wrapped around her daughter in a "bear hug."

Patterson admitted tying up and gagging the girl with tape before shooting Denise Closs in the head at close range, the court filing said.

"She too had significant head trauma," Wright wrote about the mother.

Once Patterson arrived with Jayme at his home in Gordon, he forced her to stay under his bed for hours at a time — even as he left the house for hours or had guests over, the complaint said. He allegedly surrounded the bed with storage bins, some weighted with barbells, so she couldn't see out.

On Thursday, nearly three months after Jayme was kidnapped, she escaped from Patterson's home after he told her he would be gone for five or six hours, according to prosecutors.

After he left the house, "she was able to push the bins and weights away from the bed and crawled out. JLC stated she put on a pair of Patterson’s shoes, walked out of the house and walked toward the road to a woman who she saw walking a dog.”

Patterson made a brief appearance via closed-circuit television before a judge on Monday. He was ordered held in lieu of $5 million bail.