A man suspected in brutal rapes in Montgomery County and in Georgetown in the 1990s, and in the killing of one of his victims, has been arrested in South Carolina, and authorities say they finally have the elusive “Potomac River Rapist” in custody.

The decades-old attacks along both sides of the District’s border with Maryland spanned eight years and left detectives with DNA evidence but no one to match it to.

“This man terrorized our community,” D.C. Police Chief Peter Newsham said Thursday.

New advances in genetic testing allowed police to have the genetic samples collected at crime scenes compared with people who submitted their DNA to explore their family lineage. That led police to five relatives, and detectives narrowed the list to a suspect who had lived in Maryland at the time of the attacks and worked as a landscaper.

On Wednesday morning, authorities in South Carolina arrested Giles Daniel Warrick, 60. He is to be detained there until he can be extradited to the District, where authorities said he will be charged with first-degree murder, in a rape in the District and in six rapes in Montgomery County. Online records show he has been denied bail on a fugitive from justice charge but do not indicate whether he has an attorney. He was arrested by the U.S. Marshals Service, accompanied by police from Horry County, S.C., the District and Montgomery County.

Police attribute 10 attacks in all to the suspect; they have charged him in eight cases they say he’s linked to through DNA.

The last known victim, Christine Mirzayan, was a 28-year-old who was walking home to her student apartment at Georgetown University from a barbecue on Aug. 1, 1998, when she was abducted and dragged into the woods off Canal Road in Georgetown. Police said she had been sexually assaulted and struck in the head with a 73-pound rock. Her body was found a day later.

Mirzayan had recently married and moved from San Francisco for a fellowship at the National Academy of Sciences. Her husband at the time, David Hackos, said on Thursday that he had “kind of lost hope” given the case had been open for more than 20 years. But he said he had been reading up on new DNA techniques “so I was wondering if they would ever try that with this case.”

Hackos, who has since remarried, has two children and lives in the San Francisco Bay area, said the arrest “brings a huge relief we are able to bring this person to justice,” but it also “brings us back to that time” of the killing “and we get emotional all over again.”

The attacks began May 6, 1991, when a 32-year-old woman returning home from a business trip was sexually assaulted inside her home in Gaithersburg, Md. Other attacks followed in Germantown, Potomac Village, Quince Orchard Knolls, North Potomac and Rockville. The victims in those attacks were assaulted inside their homes, at least one while her children were present. The victims included a teenage babysitter and a housekeeper.

Four of the attacks occurred in 1991, then one in 1992 and another in 1994.

The first attack in the District came in 1996 as a woman walked along MacArthur Boulevard in the Palisades neighborhood of Northwest Washington. Two more women were attacked in 1997 in Maryland and then Mirzayan was killed in 1998.

It wasn’t until 2011 that police were able to link eight of the cases using DNA and announced they were searching for a serial rapist. The FBI joined the case and formed a task force, and a billboard with a sketch of a suspect was put up at bus stations, shelters and other spots in 15 Eastern cities.

Retired D.C. police captain Michael Farish, who led the homicide unit at the time, said detectives in earlier years had not thought a killing in the District in the woods could be linked to sexual assaults committed inside homes in Montgomery County.

“That is outstanding,” Farish said when told of the arrest. He said detectives had found it odd that no one matched the DNA found at the string of crime scenes, “and for the case to just go cold like that.”

The FBI and police in the District and in Montgomery County kept the case alive. “This was truly the definition of a team effort,” Sgt. Chris Homrock, head of the Montgomery cold-case unit, said Thursday.

Homrock said detectives submitted the genetic profile they had developed from the DNA collected over the years to a Virginia company, Parabon Nanolabs, which compared it to information in a large database. Researchers found some names that didn’t match the exact profile but shared enough characteristics to suggest they were biologically related — even distantly.

Researchers and detectives then built a family-tree using traditional tools like obituaries and census records, hoping to find a path leading back to the Maryland and D.C. areas in the 1990s. Homrock credited two people with the family-tree research in this case: CeCe Moore and her team at Parabon, and Montgomery police Detective Steve “Smugs” Smugeresky, a longtime genealogy hobbyist who helps the department’s cold-case unit on such work.

Their research eventually led to several members of the same family who had connections to the area, Homrock said. In recent days, investigators fanned out to speak with them. “They were extremely cooperative,” Homrock said. “Extremely helpful.”

That led police to Warrick, learning that he had spent considerable time in the Maryland and D.C. area in the 1990s.

Starting several days ago, Montgomery County Detective Dave Davis, who works on cold cases, gave a heads-up to DNA analysts at the Montgomery crime lab that they could soon receive a quick turnaround request.

After tracking Warrick to South Carolina and questioning him on Tuesday morning, detectives used a long cotton swab to draw a sample of DNA from the inside of Warrick’s mouth. That swab was placed in a narrow box, which was placed in a manila envelope.

A call was placed to the lab in Montgomery County. “The sample is coming,” one of the investigators said, recalled Jennifer Breaux, supervisor of the biology unit of the Crime Lab.

Two officers — Smugeresky and Detective Frank Colbert — drove the sample 450 miles north, arriving at the crime lab about 4 p.m.

In an interview Thursday, Breaux described how they were able to turn the results around within about seven hours:

The sample itself, taken from the inside of someone’s mouth, was rich in DNA. And unlike a lot of genetic evidence found at crimes scenes, it didn’t have DNA from another person mixed inside. So the lab could eliminate certain extraction procedures, Breaux said.

Forensic scientists cut off a piece of the cotton, placed it into a plastic tube, treated it with chemicals and put it into a device that heated and shook it. They also amplified 24 “target areas” of the DNA by going through a heating and copying process, among other steps.

By 11 p.m. Tuesday, investigators said the lab had matched Warrick’s DNA sample to their known profile. With that, Colbert got an arrest warrant

A short time later, Warrick was taken into custody.

The new techniques, said Marcus Jones, the Montgomery County police chief, “helps us solve some heinous crimes, helps our community to feel much safer and brings families some comfort.”