Penobscot Valley Hospital of Lincoln as seen on Friday, Nov. 28, 2014.

A federal judge granted a Lincoln hospital permission to keep operating under Chapter 11 bankruptcy protection on Wednesday despite its close to $10 million in debts.

Under motions granted by Judge Michael Fagone in U.S. Bankruptcy Court in Bangor, Penobscot Valley Hospital will keep paying workers and bills on an interim basis as the hospital reorganizes its finances.

“We are very pleased with today,” hospital CEO Crystal Landry said. “Today is our first step toward financial stability so we can continue to provide hospital services in the Lincoln area.”

[Subscribe to our free morning newsletter and get the latest headlines in your inbox]

The hospital filed for bankruptcy protection on Tuesday, listing 878 creditors. Hospital attorney Andrew Helman of Portland said there were perhaps another 154 current and former patients whom the hospital might owe money. He estimated the hospital’s total debt at between $8 million and $10 million, but said that hospital officials are still compiling data.

The hospital’s greatest amount of debt appears to be from loans or alleged overpayments to the hospital from Medicare and Medicaid. The hospital’s top five creditors — state and federal agencies that handle Medicare and Medicaid — are owed $7.6 million.

Hospital officials claim in the bankruptcy court filings that they have cut the hospital’s annual net losses from $1.9 million in 2016 to an estimated $837,104 in 2018, and have cut operating costs from $23.4 million in 2016 to an estimated $19.6 million last year.

[Lincoln hospital owes up to $10M to nearly 900 creditors]

Representing the hospital’s largest creditors, a half-dozen attorneys appeared in court or spoke via conference call during the two-hour hearing Wednesday.

The key agreement concerned cash.

Fagone approved Helman’s motion seeking interim authority to use cash that creditors claimed as collateral to pay for normal hospital operations for the next 11 weeks. The hospital will share weekly updates with key creditors to ensure that it stays on budget, according to the motion.

[Lincoln hospital files for Chapter 11 bankruptcy protection]

Helman said that Penobscot Valley Hospital’s financial problems were a secondary impact of the 2015 closure of the Lincoln Paper and Tissue LLC paper mill, Lincoln’s largest single employer.

He said it was vital that the hospital continue to operate.

“We are disappointed that the hospital needed to be here, but optimistic that this can be settled,” Helman said during the hearing. He described the hospital as “incredibly important to the Lincoln region.”