BARRON, Wis. — The crime began with a chance encounter: From the moment Jake Patterson spotted a 13-year-old girl boarding a school bus last fall, he “knew that was the girl he was going to take,” Wisconsin investigators said in court documents released on Monday.

In the days that followed, Mr. Patterson, 21, mapped out his plot to abduct Jayme Closs, a middle-school student whom he had never met before, the investigators said. He took a shotgun from his father, switched out his car’s license plate and bought a mask from Walmart. He shaved his head and face — to leave no traces — and wiped clean his shotgun shells. He twice drove out to Jayme’s house in the small town of Barron, but saw cars in the driveway or people awake inside, the report says.

Then, late on an October night, Mr. Patterson pulled up again to the home of the Closs family — people he had never met — and killed Jayme’s father, James Closs, with a single blast of the shotgun. He then forced his way into a bathroom where Jayme and her mother, Denise, were hiding in a bathtub, the investigators said. He ordered Denise Closs to cover her daughter’s mouth with black tape, then killed Denise. Then he tied up Jayme and forced the teenager into the trunk of his car — all of it in a matter of four minutes.

The details of Jayme’s abduction and captivity, outlined in documents released as Mr. Patterson was formally charged in the kidnapping and killings, were elaborately planned, gruesome and terrifying. They told the story of a girl who was forced to spend three months held against her will in the cabin of a volatile stranger after having witnessed the deaths of her parents. It was the situation every parent fears — and one that experts say is exceedingly rare: a targeted attack on a child by a total stranger.