A Prince William County grand jury has indicted the man police call the East Coast Rapist on charges of rape and abduction stemming from a Halloween 2009 attack on three trick-or-treaters.

Aaron H. Thomas, 40, now faces a potential maximum of five life sentences if convicted at trial in Prince William on two counts of rape, three counts of abduction with intent to defile and related firearms charges. An initial trial date was set for July 31.

Thomas, who at one point lived in Woodbridge and was arrested in New Haven, Conn., last year, is suspected of raping women up and down the East Coast beginning in the mid-1990s. He has been linked by DNA evidence to rapes in Prince William, Prince George’s and Fairfax counties, as well as in Leesburg and New Haven.

The case was a long-standing mystery — though police had the DNA evidence linking the cases, they didn’t have a suspect to go with it — until after the Halloween 2009 attack. That crime, involving the rape of two girls at the bottom of a wooded ravine, led to a Washington Post investigation and reenergized police efforts to catch the rapist.

Ultimately, high-tech crime-fighting technology put Thomas on a list of potential suspects, and an anonymous tip led police to focus on him. Detectives surreptitiously collected DNA from Thomas in Connecticut last year, pulling it off a discarded cigarette butt, and they arrested him after it was a match.

Police officials testified at a preliminary hearing last month that Thomas admitted involvement in the crimes during interviews after his arrest, saying that he knew he was being questioned because of the Halloween case. The three girls who were abducted in Prince William County faced Thomas in court for the first time, recounting the attack and one girl’s efforts to contact police — efforts that drove the rapist off as police cars approached.

“Like most victims, they got some solace from telling their side of the story,” said Commonwealth’s Attorney Paul B. Ebert, who is prosecuting the case. “I felt they were very poised and sophisticated young women who made good witnesses. They were happy to do their part.”

Thomas’s defense lawyers pointed out at the hearing that none of the witnesses could identify Thomas as their attacker, nor could they say for certain that the rapist had a real gun. All three girls testified that the attacker approached them from behind in the dark and was wearing a ski mask that concealed all but the skin around his eyes.

“The defense will attack the evidence we have the best they can, but we intend to go forward as quickly as possible,” Ebert said.

The method of the attack matched other rapes in the lengthy string, but it was the first reported case attributed to the East Coast Rapist that involved three victims.

Ebert received the case after prosecutors in Connecticut agreed to send Thomas to Prince William to stand trial. Although Thomas has been linked to crimes in other jurisdictions in Virginia and Maryland, it is unclear whether those cases would go forward if he is convicted in his first trial. Ebert said he has not spoken to any prosecutor, other than those in Connecticut, about the case.

Thomas, who officials said had been demonstrating suicidal behavior in jail, was determined to be competent at trial after doctors examined him, prosecutors said.