An Indiana man who taunted police for decades over an 8-year-old girl's sex assault and murder was caught after investigators tracked him down, in part, using public genealogy database research, authorities said.

John Miller, 59, was arrested Sunday and later confessed to raping and killing April Tinsley in 1988, according to a police affidavit.

When detectives from the Fort Wayne Police Department approached him and asked if he knew why they were there, Miller looked at the police and said, "April Tinsley," according to the affidavit.

April Tinsley. FBI

Miller first began allegedly flaunting the crime in 1990 when officers were called to a barn where a note was found. The note said, “I kill 8 year old April M Tinsley, did you find her other shoe haha I will kill agin (sic),” according to police.

Miller aided police by leaving three used condoms — along with notes claiming responsibility for the April Tinsley murder — at three different addresses in 2004, according to police. DNA samples from those condoms were matched to the DNA profile created after the original crime.

Police then hired Parabon Nanolabs to conduct genetic DNA testing and analysis on the collected samples. The testing narrowed down the DNA to Miller and his brother, according to police.

John Miller Fort Wayne Police Department via Fort Wayne's NBC

After surveillance of Miller’s home confirmed he lived alone, police conducted a “trash pull” trying to find any material with DNA on it. Three used condoms were collected and given to the Indiana State Police laboratory for testing, according to police.

When the DNA collected from the trash matched the past samples, detectives went to Miller’s residence and he agreed to come to the Fort Wayne police department to talk, according to police.

When asked to explain what happened to April, Miller replied, “I can’t,” according to police. He then confessed to the crimes, police said.

He was charged with murder, child molesting and confinement.

Miller appeared in court before an Allen County Judge Monday morning. The judge ordered Miller held without bond as he gave prosecutors 72 hours to formally charge him.

April's mother, Janet Tinsley, described in 2015 how the hunt for her daughter's killer affected her, decades later.

"Oh, it weighs on your heart and your thoughts real heavy," Tinsley told NBC News. "You’re thinking every day — it's like, 'Who can it be?'"