The teen at first thought a friend had approached from behind in a harmless attempt to scare her as she took her morning walk in Norristown Farm Park.

But then she saw a man in a ski mask with a gun.

Detectives on Wednesday described the tense moments before the woman, then 19, was raped at gunpoint in a secluded area of the Montgomery County park in 2017. They recounted her words in the courtroom of District Judge Marc A. Alfarano in Norristown as Mason Hall sat in handcuffs, identified after a two-year investigation as the alleged perpetrator of the violent encounter.

Hall, 19, of West Norriton Township, is charged with involuntary deviate sexual intercourse, sexual assault, terroristic threats, reckless endangerment, and related offenses. Despite arguments from defense attorney Matthew Quigg, the judge ordered Hall held for trial on all charges.

“Mason is very much looking forward to his day in court,” Quigg said after the hearing, adding that his client is a “good kid” with no prior criminal record. “We’re looking forward to contest the evidence and contest the charges in a court of law, as opposed to the court of public opinion.”

Montgomery County District Attorney Kevin R. Steele, who is prosecuting the case, said the break came from a genetic profile created using DNA found in semen on the victim’s underwear.

With that profile, investigators began essentially to work backward, looking for the then-unidentified suspect’s family members in publicly available databases. That search, Steele said, led them to two suspects — Hall and his older brother.

Although he had never been arrested, Hall’s DNA already had been recovered by police: In 2017 after Hall smashed the headlights of another teen’s car during a dispute over damage to Hall’s father’s car. Hall cut himself in the process, and his blood was present on the hammer recovered by police called to the scene, detectives said Wednesday.

With help from Philadelphia Police, Steele said, county detectives in September compared the blood with the DNA from the park. It was a match.

Quigg argued that the case belongs in juvenile court because Hall was 17 when the alleged rape was committed. The lawyer said that because no gun was recovered from the scene, it’s improper to charge his client as an adult.

“We don’t know if this was a toy gun or a BB gun,” Quigg told the judge. “We know the victim thought it was a gun, but we have no idea.”

Assistant District Attorney Brianna Ringwood disputed that, saying that the woman had sufficiently described the weapon to police and that there was “more than enough evidence to connect the defendant to the violent rape.”

Hall is being held on $1 million cash bail in the Montgomery County Jail. Alfarano scheduled an arraignment for Dec. 11.