MIAMI (CBSMiami) – The court battle over who killed Miami Springs police officer Charles Stafford is over after 2 decades of legal wrangling. A plea deal, confirmed in Miami-Dade circuit court Friday, will send the man originally convicted in his death to prison for another 25 years.

Merrit Sims was convicted of the crimes of murder and robbery in 1994, sentenced to death, and waited out his appeals on Death Row until the next decade. In 2007,  the Florida Supreme Court ruled that his original lawyer hadn’t done a good job representing him, and ordered a new trial.

READ MORE: Florida Senate Bill Targets School Worker Shortages

(Source: Miami Springs Police Department) Officer Charles Stafford, the only Miami Springs police officer to die in the line of duty.

If Sims had been convicted a second time he would faced the death penalty. Instead, he agreed to plead guilty to a lesser charge, saving the family of the fallen officer the trauma of a new trial, sparing himself from death at the hands of the state, and agreeing to remain in prison until he’s old enough to qualify for medicare.

Under the agreement confirmed Friday before Miami-Dade Circuit Judge John Thornton, Sims admitted his guilt to second degree murder of a law enforcement officer and agreed to serve the next 25 years in prison. He gets no credit for the nearly 2 decades he has already served, meaning he will have spent nearly 45 years in prison before his sentence ends.

READ MORE: Miami Weather: Warmer And Wet Wednesday

When he is released at age 70, he will still have to serve 2 years of house arrest.

Officer Stafford was just 28 when he stopped Sims for a routine traffic stop at NW 27th avenue and the Airport Expressway (SR 112), 20 years ago this month. Prosecutors said the two men scuffled, and Stafford was shot dead with his own Glock pistol.

Sims ran after the shooting and ended up in California. In his first trial, Sims argued that he fired in self defense. A jury rejected that claim and decided he should face death in Florida’s electric chair. The state later abolished the chair and turned instead to lethal injection, the penalty he m ight have faced following a second conviction.

MORE NEWS: Tax Break Eyed for Florida Teachers, Cops, Military Members

Stafford is the only Miami Springs police officer to die in the line of duty. His widow and 2 daughters still live in Miami Springs, and the police department maintains a memorial web page in his honor.