A Delaware judge on Tuesday approved a $25 million credit facility for the Weinstein Co., allowing it to continue to make payroll while it is in bankruptcy.

The company obtained the debtor-in-possession financing from Union Bank, which is its primary secured creditor. Without it, the company would not have been able to pay its employees on Wednesday, according to Robert Del Genio, the company’s chief restructuring officer.

“We had $218,000 in cash as of last night,” Del Genio testified Tuesday.

The loan comes with steep fees and an interest rate of about 11.7%. The original term sheet called for a total cost of $2 million — a substantial sum, considering that the Weinstein Co. plans to draw only $7.5 million of the $25 million facility over the next five weeks.

The Union Bank financing drew objections from a rival lender, FPF Financing, which offered an interest rate of 7% and lower fees.

Judge Mary Walrath initially raised concerns that the Weinstein Co. was paying too much. Attorneys for Union Bank and the Weinstein Co. argued that Union Bank has more experience with the complex debt structures employed by entertainment companies.

“I felt more comfortable,” Del Genio testified. “They might be more expensive, but I like buying that insurance policy.”

Paul Zumbro, the attorney for the Weinstein Co., underscored that the company needed the assurance of going with a lender that is also intimately familiar with the business.

“This debtor has had a lot of deals fall apart during the course of this path from October to today,” he said. “The certainty of the Union facility is very important to the debtor. We’ve got enough fights to fight.”

Under pressure, Union agreed to substantially curtail its fees to about $950,000. Walrath ultimately overruled FPF’s objections and approved the agreement.

“It’s a close call,” she said. “I’m concerned about the amount of the interest rates… but it’s not enough to overcome the testimony of Mr. Del Genio. You went with yours rather than a newcomer.”

The Weinstein Co. is looking for a quick sale to Lantern Capital, the Dallas-based private equity firm which has bid $425 million in cash and assumed liabilities.