ALBUQUERQUE, N.M. — A man accused of beating a former New Mexico high school student in 2008 — leaving her with minimal brain activity and partially blind and deaf — was linked to the crime through DNA evidence, court documents unsealed during his first court appearance state.

A judge opened the records Friday in the case against Justin Hansen.

The records also say he was inconsistent in his statements to detectives in January when he was first questioned in the beating.

Victim Brittani Marcell has few memories of the attack. However, she told detectives in October that she had started to remember Hansen visiting her at the Cottonwood Mall sunglasses store where she worked in the months before the beating.

She said she knew Hansen as the ex-boyfriend of a friend.

The complaint says Hansen gave varying information about how well he knew Marcell, then 17. Hansen was 24.

After Hansen refused to give detectives a DNA sample, detectives went undercover, following him to a McDonald’s and retrieving a sample by pulling a cup used by Hansen from the trash, court records say.

Investigators say the DNA matched blood found on glass on the porch of the crime scene.

Hansen’s public defender, Sophie Cooper, said she does not believe the DNA evidence laid out in the affidavit is conclusive, and the affidavit doesn’t say whether Hansen’s DNA matched other samples found at the house.

Hansen is charged with kidnapping with great bodily harm, attempted murder and other crimes.

He was arrested Wednesday and had his first court appearance in the 2nd Judicial District Court on Friday.

Hansen will remain in jail until Tuesday, when he will appear before Judge Charles Brown again for a hearing on whether he will stay in jail until trial.