Not even a week after rejecting a federal guilty-plea agreement for the second time, West Philadelphia abortion doctor Kermit Gosnell has changed his mind again.

Defense attorney Jack McMahon confirmed Tuesday that Gosnell, 72, had signed a new plea agreement with the federal prosecutor to resolve a case charging him with selling prescriptions for dangerous narcotics.

McMahon said Gosnell signed the agreement over the weekend and will make it official Tuesday in a hearing before U.S. District Judge Cynthia M. Rufe.

In this latest version of the plea agreement, McMahon said, prosecutors agreed to drop a count charging Gosnell with running a continuing criminal enterprise - which carries a mandatory minimum of 20 years in prison - as well as counts charging him with selling drugs in a school zone.

McMahon said that Gosnell had a personal objection to the school-zone count and that the lack of a criminal-enterprise charge and its mandatory minimum will leave the sentence up to the judge.

Regardless of Rufe's sentence, Gosnell will never get out of jail alive. He is serving three consecutive life terms for killing infants born alive during illegal late-term abortions.

After Gosnell balked at the last proposed plea agreement last Wednesday, Rufe set trial for Sept. 9 and warned Gosnell that the date was firm unless he pleaded guilty before then.

It was a Feb. 18, 2010, drug raid on Gosnell's Women's Medical Society clinic at 3801 Lancaster Ave. that resulted in the discovery of more than 45 frozen fetal remains. That discovery triggered a Philadelphia grand jury probe that ended with murder charges against Gosnell and four employees, and illegal-abortion counts against five others.

The federal charges against Gosnell involved the sale of almost a million pills containing the narcotic painkiller oxycodone and the generic version of the antianxiety drug Xanax.

Those two drugs and scripts for more than 19,000 ounces of codeine-based cough syrup - all coveted by addicts - were allegedly sold for cash out of the clinic from 2008 through January 2010 under cover of what Gosnell called his "pain-management practice."

Gosnell was indicted by a federal grand jury with three ex-employees, and the U.S. Attorney's Office separately charged four other Gosnell workers.

All of the federal defendants but Gosnell pleaded guilty. None has been sentenced in case their testimony was needed at Gosnell's trial.

According to the indictment, Gosnell began selling prescriptions in 2008, writing several hundred bogus prescriptions a month. By January 2010, Gosnell was writing more than 2,300 scripts a month and was Pennsylvania's third largest prescriber of oxycodone.