For more than 30 years, Richard E. Ricketts got away with raping a woman outside her Rockville apartment. Then Montgomery County cold-case detectives reopened the case and tested old evidence for DNA — leading to Ricketts, his conviction this year and his sentencing hearing Friday.

“You are a wretched and warped man,” Montgomery Circuit Court Judge Terrence J. McGann told the 64-year-old. “Whatever good qualities you may possess have been smothered over the years by your evil ones.”

McGann then sentenced to Ricketts to life in prison.

The judge said the rape created a nightmare that the victim lived with for decades. “How often did she wonder if her rapist was watching or stalking her?” McGann asked from the bench.

On Oct. 24, 1977, the victim, then 25, arrived home from work.

Richard E Ricketts

As she was walking to her apartment building, a man attacked her from behind, putting his left arm around her neck and right arm over her mouth to stop her from screaming, according to Montgomery police records.

The man forced her to the ground, pulled up her dress and ordered the woman to take off her underwear. He raped her and ran away, according to police.

An investigation extending into 1978 failed to come up with viable suspects. The case became inactive.

In 2011, the county’s cold-case unit reopened it, working with evidence still in police storage. The detectives submitted swabs from the victim’s body to a lab for DNA analysis, and the results were checked against a national database of convicts.

It matched Ricketts’s DNA. He had been convicted in Florida in 1999 of burglary and sexual battery and was doing time in that state, according to arrest records.

In February, Ricketts went on trial in Montgomery. The victim testified, her memory clear about the attack.

At first, she told the jury, she tried to push the man away. Then she pleaded with him not to hurt her. Then she realized that she couldn’t escape — and was afraid she would be killed. “I just really wanted it to be over,” she said from the witness stand. “I was just whimpering.”

Afterward, she said, a couple at a nearby apartment took her in and called the police.

A jury convicted Ricketts of first-degree rape and two counts of first-degree sex offense.

Ricketts spoke in court Friday moments before McGann sentenced him.

“I think I’m not guilty of the charges as they were brought against me,” he told the judge. He added that he was prepared to receive a long sentence. “I know how to do it. I know how to accept it. I know how to handle it.”

Montgomery State’s Attorney John McCarthy said in a statement, “This verdict and sentence show that you cannot outrun the long arm of the law. Thank goodness for the DNA database.”