BARRON, Wis. — It was as random — and terrifying — as it gets.

Jayme Closs’ accused killer kidnapper told cops he was driving to work one day when he spotted the apple-cheeked 13-year-old at her bus stop — and decided to abduct her.

“On his drive to the cheese factory on one of the two mornings he worked there, he had stopped behind a school bus on US Hwy. 8 where he watched J.L.C. [Jayme] get on a school bus,’’ chilling court papers revealed Monday.

“The defendant stated he had no idea who she was … [but] when he saw [Jayme], he knew that was the girl he was going to take.”

Suspect Jake Thomas Patterson, 21, admitted to detectives “that he had never met J.L.C. through any social media sites and only learned her name after the abduction and when he got back to his house,’’ the documents added.

The psycho — who was ordered held on $5 million cash bail at his first court appearance Monday — revealed in methodical detail his heinous crime, which began with Jayme’s parents being shot in the head , each with a single bullet, authorities said.

The teen’s mom, Denise, would die trying to protect her daughter, hiding with her in a bathtub — until Patterson found the pair and killed the mother with a bound Jayme standing next to him, they said.

The documents showed that police appeared to have been this close to nailing Patterson before he fled with Jayme, who was held hostage for 88 days, beaten and abused, until she escaped Thursday.

Patterson told detectives that within “20 seconds’’ of leaving the Closs family house, three blaring police cars passed him on the road. Jayme said she could hear the sirens, too, from the trunk.

Patterson — a failed Marine-wannabe who couldn’t keep a job and lived in a cabin in the woods about an hour from the Closses — said he got Jayme’s address simply by waiting till she got off the school bus one day and following her home.

He then tried twice to kidnap her at her house, but there were too many people around.

Before finally succeeding the night of Oct. 15, Patterson said, he made sure to take precautions.

For example, he shaved off his beard and all his hair “so that he would not leave any DNA or hair at the scene,’’ the papers said.

That night, Patterson drove up to the Closs house in his old red Ford Taurus wearing gloves, a black jacket, jeans, brown leather steel-tipped military-style boots — and a black balaclava-type mask he had bought from Wal-Mart within a day of first spotting Jayme at her bus stop, he told cops.

He toted a kitchen knife and a carefully chosen second weapon — his father’s 12-gauge silver and black Mossberg shotgun — loaded with six bullets, cops said.

“The defendant stated he felt that a 12-gauge slug would inflict the most damage on someone and would most likely be the best choice of shell and weapon to kill someone versus a rifle,’’ according to the criminal complaint.

Jayme had awoken to her dog Molly barking, saw what appeared to be a man lurking outside and went to tell her parents. Patterson told police he soon spotted Jayme’s dad, James Closs, standing in front of the home’s large front picture window.

The suspect said he began pounding on the family’s front door and that James Closs thought he might be a cop and demanded to see his badge.

Patterson shot a single bullet at the dad’s head through a small window in the door and burst into the house, he told cops.

Jayme told police “she heard a gunshot — and knew her father had just been killed,’’ the court papers said.

Then Patterson hunted for Jayme inside the home, he said.

It was dark, but he used his flashlight to spot a shut door down the hall. He said it was locked and barricaded, taking him “10 to 15 hits with his shoulder’’ to break the door down.

Inside was the bathroom — and he saw the shower curtain pulled closed, Patterson said.

He ripped the curtain off its rod, exposing a terrified Jayme and her mother, Denise, sitting huddled in the tub — “Denise with her arms wrapped around J.L.C. in a bear hug,’’ the report said.

The mom had frantically phoned 911 at 12:35 a.m., just as Patterson was busting in, but the killer interrupted.

Patterson said he pulled out a roll of black duct tape and ordered the mom to put it over her daughter’s mouth.

As a stricken Denise fumbled with the roll of tape, he grabbed it from her and did the job himself, binding Jayme’s head, wrists and ankles, he said.

Then, with the bound teen standing next to him, he shot to death her mother, Patterson said.

“The defendant stated he aimed for Denise’s head because he knew that head shots were the best way to kill a person,’’ the documents said.

Patterson told cops he killed the couple because he couldn’t afford leaving any witnesses behind. He admitted that he only learned their names after seeing reports about the crime on TV and social media.

He said he then dragged Jayme to his car, stuffed her in the trunk and drove them to an isolated family cabin in Gordon — passing the cop cars along the way.

Once at his empty house, he dragged the crying teen to his bedroom, where he forced her to spend the next nearly three months under his bed, Patterson admitted.

Jayme said the killer “would make her stay under the bed for up to 12 hours at a time, with no food, water or bathroom breaks.’’

He also beat her at least once and screamed threats to warn her against ever trying to escape, she said.

The suspect described keeping a mound of workout weights against the bed to keep Jayme prisoner.

He was so smug about the set-up that he even had visitors, including his father, but he would make sure she was securely barricaded in her prison and turned up the music loud to mask any noise she might make, police said.

Jayme said she was finally able to escape when Patterson told her he was leaving “for five or six hours’’ and she managed to push the weights from the bed.

Dressed in leggings and a hoodie and wearing a pair of Patterson’s old dirty New Balance sneakers — which she put on the wrong feet in her rush to escape — Jayme fled.

She ran toward the road and encountered neighbor Jeanne Nutter, who was walking her dog, around 4:10 p.m.

Nutter said that while Jayme was thin and dirty, she recognized her from all the publicity surrounding her disappearance.

“He killed my parents,’’ the exhausted-looking teen told her. “Please help — I want to go home.’’

Nutter brought her to a nearby home, and police were called. Meanwhile, Patterson arrived back at his cabin and discovered Jayme gone, spotting her footprints outside, he told cops.

He drove around futilely looking for her, then headed toward home in defeat, authorities said.

Cops were there to greet him.

As a police sergeant ordered him out of his vehicle, “Patterson stated, ‘I know what this is about. I did it,’ ” the documents said.

At his first court hearing Monday, Patterson was held on $5 million cash bail — where he appeared via video link from jail while about 15 of Closs’ tearful relatives watched in the courtroom.

As the charges were read against him — including for the double murders and kidnapping — Patterson stared straight ahead and remained expressionless.

Seats were reserved on the other side of the courtroom for Patterson’s relatives although it didn’t appear anyone came.

He faces up to life in prison on each homicide charge alone.

Patterson’s next court appearance was set for Feb. 6 at 11 a.m.

Jayme’s family and Wisconsin prosecutors praised the child’s bravery and said she is thrilled to be back with them and safe.

Barron County DA Brian Wright called Jayme an “unbelievable’’ teen, and said she will not be asked to take the witness stand, at least at this point.

As the teen’s grandfather, Robert Naiberg, said, Jayme is doing well, but “You can tell she’s not quite the same.’’