When Robert McDowell gave his friend Gerald Drummond a ride and handed him a gun later used to kill a man and a 15-year-old boy on a Tacony street in July 2007, he set in motion a series of events that ended with both of them being convicted of murder and sentenced to life in prison without the chance for parole.

On Monday, McDowell, 38, learned that he will not die in prison, but instead would be released very soon, according to his lawyer.

McDowell was scheduled to be retried for the slayings starting Monday in Philadelphia Common Pleas Court, after a federal judge this year granted him a new trial because the state judge who sentenced him erred in properly explaining reasonable doubt to the jury.

Instead of picking a jury for the retrial, the District Attorney’s Office offered McDowell a plea deal of 7½ to 15 years in prison, which makes him eligible to immediately seek parole because he has already served more than the minimum sentence.

McDowell’s bushy beard and face mask could not conceal his smile as he accepted the deal, which also includes 10 years of reporting probation.

Speaking to Judge Glenn Bronson, McDowell acknowledged his victims and said “I look forward” to going home and making something out of his life.

“This was a terrible, awful crime. It was senseless, it was brutal,” said Bronson, who added that in accepting the plea deal, he took into account that McDowell “did not pull the trigger" and that two witnesses who testified against him had since died.

“When I consider all the things that I know about this case, I’m willing to accept the recommended sentence,” said Bronson, who noted that he had denied McDowell’s petition for a new trial before the defendant appealed to federal court.

“Mr. McDowell, you have had some great fortune” within the criminal justice system, Bronson said in the nearly empty courtroom in which everyone present wore masks.

McDowell’s “fortune” came on the same day that U.S. Attorney William M. McSwain held a news conference to accuse Philadelphia District Attorney Larry Krasner of being lenient with violent offenders by offering them plea deals that allowed them to return to the streets, where some committed new crimes. He cited 12 such cases. “These policies create a culture of lawlessness; they leave criminals emboldened; and they have inevitable consequences — one of which is a murder rate in Philadelphia that is the highest it has been in nearly 15 years,” McSwain said.

Assistant District Attorney Robert Wainwright declined to comment on McDowell’s plea deal after leaving the courtroom. Jane Roh, spokesperson for District Attorney Larry Krasner, declined to comment.

McDowell’s attorney, William Davis, said, “He was serving two life sentences, so he’s very grateful that we were able to resolve this with a 7½-to-15 sentence.”

In pleading guilty to two counts of third-degree murder, criminal conspiracy and a weapon offense, McDowell for the first time admitted in court that he provided Drummond with the gun that was used to kill Damien Holloway, 27, and Timothy Clark, 15, on July 13, 2007.

Roh, Krasner’s spokesperson, emailed a statement from Matthew Clark, Timothy Clark’s brother, supporting the office’s handling of the case.

“I believe the sentence is fair because Robert McDowell wasn’t the actual shooter. The District Attorney’s Office absolutely kept me informed throughout this process, I was consulted and involved the whole way,” wrote Matthew, who said by phone that his mother and another brother had both died since McDowell was convicted.

Although neither Drummond nor McDowell testified during their trial nearly a decade ago, their attorneys at the time argued that neither man was even present when the victims were gunned down, execution-style, on Vandike Street near Longshore Avenue.

Back then, prosecutor Carlos Vega told the jury that both were there and that McDowell brought the gun but lacked the heart to shoot. So he handed the weapon to Drummond, who ordered the victims to their knees before shooting both in the head, Vega said.

Holloway had a rocky dating relationship with Drummond’s sister, with whom he had a child, and Drummond did not like how the victim had been treating her, Vega told the jury. Drummond shot Clark because he happened to be with Holloway at the time, Vega argued.

The jury that convicted McDowell and Drummond could not reach a unanimous verdict on sentencing the pair to death, so under state law they received life sentences. Drummond is still behind bars but is trying to get a new trial as well, Davis said.

Staff writer Julie Shaw contributed to this article.