An Alexandria nurse pleaded guilty Thursday to a 2016 rape solved using a genealogical database.

Jesse Bjerke, 38, followed a ­24-year-old lifeguard to the local pool where she worked one day that September, pointed a gun at her head and assaulted her. He confessed Thursday in Alexandria Circuit Court to rape, abduction and gun crimes.

He was ordered to undergo a psychosexual evaluation before his sentencing on March 19. He must register as a sex offender.

Bjerke was one of the first offenders identified in Virginia using forensic genealogy, an increasingly common technique for solving cold cases where police have little evidence beyond DNA. Bjerke had no criminal history, and so his DNA was in no law enforcement database. But sperm left at the crime scene matched with relatives of Bjerke who had uploaded their genetic information to public genealogy databases.

After the plea, Commonwealth’s Attorney Bryan Porter praised the “outstanding use of technology.”

“Without genetic genealogy in this case, a violent rapist would not have been identified,” he said.

Attorneys tried to suppress the DNA evidence as an invasion of Bjerke’s privacy. As part of the agreement, Bjerke’s attorneys can appeal that issue to a higher court, and if they prevail, his guilty plea can be withdrawn. At sentencing, prosecutors can ask for any term of years in prison but not life.

Bjerke is also under investigation for a similar rape at a pool in Fairfax County in 2015. Judge Lisa Kemler said that if he pleads guilty in Fairfax, the sentencing hearing in Alexandria could cover both offenses.

Porter would not comment on that “open investigation.”

Bjerke said little other than softly answering “guilty” to the four counts and “yes” to questions from the judge.

“He has many, many friends and family,” defense attorney Chris Leibig told the judge in explaining his plans to ask for leniency in sentencing. “He’s worked successfully as a nurse for a long time.”

Bjerke was a stranger to the woman, who was a European working in Washington for the summer.

“It was an overcast and unseasonably cold day, and there were no guests at the pool,” prosecutor Jessica Smith said in court. It was early afternoon when Bjerke came in and asked the victim whether she had seen a pair of flip-flops. After following her around the pool area to a pump room, he pointed a gun at her.

“Stop screaming or I’ll shoot you in the mouth,” Smith said he told the woman. “I am going to rape you, kill you or I will do both.”

Bjerke tied her hands behind her back with zip ties, put on latex gloves and raped her, hitting her in the head several times and telling her not to look at him.

DNA was taken from nine other people before Bjerke was identified, Smith said in court, including someone who bought blue latex gloves at Home Depot the day of the crime and a man identified as a possible suspect by his mother.

“This particular case struck a lot of fear and apprehension in this community,” Police Chief Michael Brown said. “We never gave up.”

But “we were basically at a dead end” until 2018, he said, when investigators from a company called Parabon NanoLabs used the website to link a DNA sample from the crime to people in Bjerke’s family.

He was quickly identified as the likely perpetrator based on age and location, and police then followed him to an Old Town restaurant and captured his DNA from two straws. It was an apparent match. A search warrant was issued in February and after another DNA test found there was only a 1 in 7.2 billion chance the sperm was not his, he was arrested.

Attorneys for Bjerke argued that the DNA profile was illegally obtained. No warrant was issued before police grabbed the straws, and Bjerke did not consent to having his genetic material retrieved and analyzed. Kemler concluded that a warrant was not required for “abandoned property” and that using DNA to establish identity does “not reveal private, personal information.”

“While the Commonwealth understands that a balance between personal privacy and investigation must be struck, that balance is achieved when a rapist voluntarily abandons property,” Porter said.

There are still few court decisions guiding the increasingly prevalent use of public DNA websites to solve crimes. The case is the first of its kind to be challenged in Virginia state court.

“DNA is a treasure trove of information just sitting there, and there’s nothing preventing them from doing anything with it,” Leibig said at a hearing earlier this year. “There needs to be a rule” that is not “pure trust in the government.”

Smith emphasized that the evidence against Bjerke went beyond the DNA.

While Bjerke denied owning a gun, both a former co-worker and a police officer who had worked with the defendant recalled him talking about having one. He was scheduled to work in the emergency room at Inova Alexandria Hospital the date of the offense but took “unscheduled leave” because he was not feeling well. Cellphone records indicate he then traveled to the pool. The phone next connected to a tower near Bjerke’s home.

On his computer, Smith said, Bjerke showed “an unusual interest in news articles concerning genetic genealogy,” in particular, “cold case rapes being solved.”

Not long before his arrest, she said, he had told his employers and landlord he was planning to leave the area and become a traveling nurse.