The bankrupt parent of the former Hahnemann University Hospital has agreed to buy malpractice insurance that will protect hundreds of medical residents who trained at the Center City hospital before it closed last summer, according to a court filing Thursday.

If the bankruptcy judge approves the proposal, which will cost $9.3 million, the insurance coverage — known as “tail insurance” because it will cover incidents far into the future — eliminates the possibility of residents’ losing their licenses if they didn’t have the insurance.

It also covers fellows and physicians who worked at Hahnemann while it was run by Joel Freedman, the California business man who paid $170 million for Hahnemann and St. Christopher’s Children’s Hospital in January 2018.

“That’s wonderful news. This was a cause for incredible amounts of stress for us,” said Atul Bali, now a third-year resident at the Hospital of the University of Pennsylvania. He said residents were receiving individual quotes for the insurance north of $25,000 and up to $50,000.

The Pennsylvania Academic Risk Retention Group LLC will provide the insurance coverage. Hahnemann will pay $6.2 million for the coverage. The rest will be covered by the malpractice insurer, which is owned by Freedman.

For months, Hahnemann insisted that it had no obligation to purchase tail insurance for the residents. However, in December, lawyers hired by the American Medical Association ratcheted up the pressure on Hahnemann by asking the bankruptcy judge, Kevin Gross, to convert the bankruptcy to a liquidation if Hahnemann did not buy the insurance.

The risk of litigation over that effort to compel the purchase and the threat of liquidation were among the reasons Hahnemann decided to buy the insurance. Hahnemann’s “efforts also resulted from a genuine desire to mitigate at least some of the harm to the regional medical community caused by Hahnemann’s closure,” the filing said.

The AMA said Thursday that it is “cautiously optimistic that, with today’s settlement filing, relief may be just around the corner for hundreds of residents and fellows impacted by the Hahnemann closure. This would be a significant victory, not just for these physicians, but for the patients they serve."

David Aizenberg, who was the director of Hahnemann’s largest residency program, in internal medicine, and has doggedly advocated for a solution, said that, in addition to the national medical association, the Philadelphia County Medical Society, the Pennsylvania Medical Society, and others “were instrumental in guiding our former trainees through this crazy process.”

“The lives of former trainees at Hahnemann Hospital could have been significantly impacted by not obtaining tail coverage,” said Aizenberg, who now works at the Hospital of the University of Pennsylvania. “Many of them would not have been able to afford purchasing it on their own and their future careers may have been placed in jeopardy. The hospital has done the right thing by agreeing to purchase this,” he said.

Thursday’s filing contained the additional news that Thomas Jefferson University Hospitals Inc. on Tuesday terminated its agreement to pay $55 million for Hahnemann’s medical residency programs. The bankruptcy judge approved the sale in September, but officials at Medicare, which pays the salaries of the residents, appealed the decision to U.S. District Court, where was still pending.