BARRON, Wis. -- A 21-year-old man shot a Wisconsin couple to death at their home in a scheme to kidnap their teenage daughter, then held the girl captive for three months in an isolated north woods town before she managed to escape, authorities said Friday.

Jayme Closs, 13, was skinny, disheveled and wearing shoes too big for her when she approached a stranger and pleaded for help Thursday in the small town of Gordon, where Jake Thomas Patterson lives.

Patterson was apparently out looking for her when he was arrested and jailed on kidnapping and homicide charges, Barron County Sheriff Chris Fitzgerald said.

The news that Jayme was safe set off joy and relief 60 miles (96 kilometres) away in her hometown of Barron, population 3,300, ending an all-out search that gripped the state, with many people fearing the worst the longer she was missing.

“My legs started to shake. It was awesome. The stress, the relief - it was awesome,” Fitzgerald said, describing the moment he learned Jayme had been found.

Jayme told one of the neighbours in Gordon who took her in that she had walked away from a cabin where she had been held captive.

“She said that this person's name was Jake Patterson, 'he killed my parents and took me,”' said another one of the neighbours, Kristin Kasinskas. “She did not talk about why or how. She said she did not know him.”

The sheriff said investigators are trying to figure out what happened to Jayme during her captivity and why she was seized, and gave no details on how she escaped except to say Patterson was not home at the time. He said there is no evidence Patterson knew Jayme or her family or had been contact with her on social media.

“I know all of you are searching for the answer why any of this happened,” Fitzgerald said. “Believe me, so are we.”

The sheriff said that he did not know if Jayme had been physically abused but that she was hospitalized overnight for observation and released after an exam. Investigators were still interviewing her, and she was “doing as well as circumstances allow,” he said.

Kasinskas called 911 to report the girl had been found after another neighbour out walking her dog encountered Jayme and brought her to Kasinskas' house. Minutes later, Patterson was pulled over by a sheriff's deputy based on a description of his vehicle Jayme provided, authorities said.

He was scheduled for an initial court appearance Monday. It was not immediately known whether the unemployed Patterson had an attorney.

Jayme's grandfather, Robert Naiberg, said he had been praying for months for the call he received about his granddaughter.

“I thought, 'Good for her she escaped,”' he said.

Jayme disappeared from her home near Barron after someone broke in and shot her parents, James and Denise Closs, on Oct. 15. The sheriff said investigators believe Patterson killed them in order to abduct the girl.

Patterson tried to avoid leaving evidence at the scene of the killings, taking such steps as shaving his head beforehand, the sheriff said. A shotgun similar to the one used was recovered from the home where police believe Jayme was held, the sheriff said.

Property records show that the cabin belonged to Patterson's father at the time of Jayme's disappearance.

Patterson worked for one day in 2016 at the same Jennie-O turkey plant in Barron as Jayme's parents, Jennie-O Turkey Store President Steve Lykken said. Patterson quit the next day, saying he was moving from the area, Lykken said. But the sheriff said it did not appear Patterson interacted with them during his brief time working there.

Patterson had no criminal record, according to the sheriff. He graduated in 2015 from Northwood High School, where he was on the quiz bowl team and was a good student with a “great group of friends,” said District Superintendent Jean Serum.

Kasinskas said she taught Patterson science in middle school, but added: “I don't really remember a ton about him.”

“He seemed like a quiet kid,” she said. “I don't recall anything that would have explained this, by any means.”

The woman who first spotted Jayme on Thursday, Jeanne Nutter, said she was walking her dog along a rural road when a disheveled girl called out to her, grabbed her and revealed her name.

“I was terrified, but I didn't want to show her that,” Nutter, a social worker who spent years working in child protection, told The Associated Press. “She just yelled, 'Please help me! I don't know where I am! I'm lost!”'

Nutter took her to the home of Peter and Kristin Kasinskas. Jayme was quiet, her emotions “pretty flat,” Peter Kasinskas said.

Jayme told the couple she didn't know where she was or anything about Gordon, a town of about 644 people in a heavily forested region where logging in the top industry. From what she told them, they believed she was there for most of her disappearance.

After Jayme vanished, detectives pursued thousands of tips, watched dozens of surveillance videos and conducted numerous searches. Officials recruited 2,000 volunteers for a huge ground search Oct. 23, but it yielded no clues.

Fitzgerald said in November that he kept similar cases in the back of his mind as he worked to find Jayme, including the abduction of Elizabeth Smart, who was 14 when she was taken from her Salt Lake City home in 2002. Smart was rescued nine months later after witnesses recognized her abductors from an “America's Most Wanted” episode.

Smart said in a telephone interview that Jayme's story is “why we can never give up hope on any missing child.”

“It was only a few months ago that we as a community gathered to pray for Jayme's safe return at Barron High School,” Barron County District Attorney Brian Wright said at a news conference. “God has answered those prayers.”