Rafael Andres served just 18 months behind bars for the murder of a Miami woman in 1987.

For his second murder, Andres received the ultimate punishment. A Miami-Dade judge on Wednesday sentenced Andres to death for beating, stabbing and using a rice-cooker cord to strangle 31-year-old waitress Yvette Fariñas in 2005.

“When you took that rice-cooker cord and wound it around her neck, the evidence is clear. She was alive. She knew you were strangling her,” Miami-Dade Circuit Judge Dava Tunis told Andres on Wednesday. “She fought you for her life.”

The judge noted that Andres, 51, served “very little time” for the 1987 murder of 32-year-old Linda Azcarreta. Andres stabbed her to death — he claimed in a frenzy of drug use — then cashed a $100 check meant for the woman. In that case, he pleaded guilty and agreed to serve nine years. But under prison rules for good behavior, he walked free after just 18 months — lenient punishment not unusual in a then-overcrowded prison system.

“You were still a young man. You had the opportunity to live a productive life,” Tunis said. “Unfortunately, you did not learn and committed a second heinous murder.”

Wednesday’s final sentencing capped a decade of legal wrangling before the trial court. A jury last year convicted Andres of first-degree murder and other felonies. The jurors, by a 9-3 vote, recommended the death penalty.

The dual tragedy united relatives of both victims. Last year in court, Azcarreta’s adult son — who as a child discovered his mother’s body inside her home — attended the court hearings, comforting the Fariñas family.

Rene Azcarreta spoke to the judge for the first time Wednesday, describing his mother as an “amazing woman” who never got to see her son grow into adulthood.

“I wanted to thank you for allowing me to speak,” Rene Azcarreta tearfully told the judge. “As a child I never had that opportunity to express the excruciating loss I had to deal with and the effect this has caused on everyone in my family.”

After the hearing, Rene Azcarreta and Fariñas’ parents embraced each other. “Peace,” Azcarreta said when asked to describe his emotions.

In 2005, Fariñas and her boyfriend lived in an efficiency attached to a house in the 7300 block of Southwest 12th Street. Andres was a handyman who had been hired to do renovations on the home.

His DNA was found on a bloody washcloth found near Fariñas’ body. A neighbor identified Andres, holding a gas can, leaving the home just before the crime scene went up in flames.

Andres also used her ATM card to withdraw cash, buy goods at The Home Depot, fuel up his van and pay for a stay at the Miccosukee Resort and Casino.