Frank Weston, a drifter accused of killing a Time-Life Books employe five years ago in one of Old Town Alexandria's most brutal crimes, pleaded guilty yesterday to murder, rape and robbery and was given three consecutive sentences of life in prison.

"For years nobody could solve this crime," Weston told a hushed courtroom filled largely with the relatives of Connie Mellon, a South Carolina native who was killed in her town house a few weeks after she moved to Virginia from New York.

"I called these people here because I wanted to clear my conscience," he said in a rambling, seven-minute monologue. "This evil thing came upon me. I defiled myself and I defiled my soul."

After listening to Weston, 31, repeatedly beg for forgiveness, Alexandria Circuit Court Judge Alfred D. Swersky sentenced him to three consecutive terms of life in prison. Under Virginia law, the earliest Weston can be considered for parole is in 20 years.

"We had to weigh the risks of a trial," said Alexandria prosecutor John E. Kloch, explaining why he accepted the plea. "We got what we want. This man will never be out on the street again."

The plea arrangement, concluded only two hours before the hearing, brings to a resolution one of the city's most highly publicized and, according to several police investigators, brutal crimes.

Mellon's body was found Oct. 7, 1980. Four days earlier she had been raped, bound and shot in the head.

For almost a year police said the slaying appeared to be without motive, and they had no suspects.

In August 1981, ballistics tests revealed that the gun used to kill a clerk in a Pittsburgh shoe store on Oct. 4, 1980, was the weapon that had killed Mellon the day before.

Weston was indicted by an Alexandria grand jury on Aug. 3, 1981, on the three charges in the Mellon killing, but prosecutors had to spend more than four years to get him extradited from Pittsburgh.

After finding him guilty of the first-degree murder of Robert Walker in the shoe store killing, Pittsburgh Judge Henry R. Smith delayed imposing sentence, saying that he believed that a jury should decide whether Weston should die or be imprisoned for life for the crime.

In April, after the Pennsylvania Supreme Court ruled against the judge's position, Weston was sentenced to life in prison.

Alexandria authorities immediately returned him to Northern Virginia to await trial in Alexandria.

Yesterday's hearing lasted 15 minutes, and seven were consumed by Weston's rambling and, at times, incoherent monologue.

Kloch said that he accepted the plea arrangement because under Virginia law he would have had to prove that Weston committed the robbery or rape in addition to the murder to get Weston sentenced to die in the state's electric chair.

One of Weston's attorneys, Edward S. Rosenthal, said that the sentence was the best he could have hoped for.

"Given the facts of this case," Rosenthal said, "the most likely outcome of a trial would have been the electrocution of my client. It was obviously a very horrible crime."

"I confess to the crime and I'm very sorry I did it," Weston told the judge. "I was in the dark then.

"I know I'm going to die in jail. I'm not afraid and I'm not a liar."

Eleanor Mellon Dunham, the dead woman's sister, who had written letters for years in an attempt to speed resolution of the case, said after the trial she was grateful that it had ended.

"We all want to thank Mr. Kloch and his staff for what they did," she said. "I want to forget the worst of these years."

Kloch said that Weston would be returned immediately to Pennsylvania authorities to begin serving his life sentence there.

Should Weston win parole there, a step that Kloch said was unlikely, Weston would be returned to Virginia to begin serving the sentences he received yesterday.