A 42-year-old convicted sex offender pleaded guilty yesterday to raping a former Prince William County high school teacher in 1990 in a case solved after investigators blindly sent his genetic material to a national DNA database.

Terry L. McDonald, who is serving a 48-year sentence for sexual assault in West Virginia, pleaded guilty in Prince William County Circuit Court to rape and abduction with intent to defile. Assistant Commonwealth's Attorney Timothy M. Olmstead said prosecutors will ask Judge LeRoy F. Millette Jr. to give McDonald the maximum punishment -- two life terms in prison -- at his Oct. 29 sentencing.

The 1990 cold case had virtually no leads until West Virginia authorities entered McDonald's DNA sample into the Combined DNA Index System late last year. Prince William County investigators got a "cold hit" in January when McDonald's DNA matched genetic material that had been recovered from the victim and stored in the database, Olmstead said. If the DNA match had not been made, McDonald could have been released in West Virginia in 2027 after a scheduled parole hearing.

"This is pretty rare, especially in violent crimes. . . . It's one of those times you're like, 'Wow,' "

Olmstead said. "It's different from someone coming forward who was an eyewitness to a cold crime. This eyewitness has lab analysis and science behind it, and it's more credible."

McDonald was indicted in Prince William on April 5 on four charges. Prosecutors dropped forcible sodomy and aggravated malicious wounding counts in exchange for the plea, thinking that the potential for two life sentences was severe enough, Olmstead said.

Authorities said that on July 26, 1990, McDonald saw the teacher pushing her bike at 8:30 a.m. along Mountain Road toward Route 15 near Haymarket. He got out of his car, asked her for directions and then punched her in the face. He dragged her into a wooded area and raped her, police said.

A day before the rape, McDonald, serving time on burglary and sexual assault charges, had escaped from a "road gang" of prisoners working in West Virginia. That night, he sexually assaulted a West Virginia woman and stole her red 1983 Datsun, Olmstead said. He later drove to Florida, where a state trooper spotted him a month later in the stolen vehicle and arrested him. He was extradited to West Virginia.

Assistant Commonwealth's Attorney Richard A. Conway told Millette yesterday that McDonald recounted his rape of the high school teacher to authorities while he was being escorted from prison in West Virginia to Prince William County in May.

Because the rape occurred before parole in Virginia was abolished in the mid-1990s, McDonald technically has a chance to be released. But a parole board is unlikely to release him, given his criminal record, Olmstead said.

McDonald has been "very apologetic," said his attorney, Michael A. Pignone. "He realizes he needs some help."