White Plains, N.Y. – A new dispute between Sears Holdings and its prospective buyer could jeopardize the last-minute bid to save the retailer from liquidation.

Sears bankruptcy attorney Ray Schrock said Monday in a court hearing that the company does not agree with hedge fund ESL Investment’s interpretation of their deal to preserve Sears in shrunken form.

ESL, which is owned by controversial Sears chairman and former CEO Eddie Lampert, is not prepared to assume up to $166 million in accounts payable as part of its agreement to buy the retailer, Schrock told Judge Robert Drain.

“We think the agreement is clear the way it is drafted,” Schrock said.

He said Sears and ESL are “talking about that issue” and hope to resolve it. But he acknowledged that the dispute may linger as the judge continues a court hearing to rule on whether Lampert should be allowed to buy the company.

ESL said in a statement after the hearing that it "remains committed to working with the debtors to resolve any outstanding matters related to our going concern bid.”

Abid Qureshi, an attorney for a group of unsecured creditors who oppose the Lampert deal and believe Sears should be liquidated, said "we were quite surprised” when the dispute surfaced late Sunday.

“We think we’re entitled to know what the objection is,” Qureshi said.

Schrock said Sears is still hoping to win the judge’s approval for the sale this week and close the transaction Friday.

If the deal collapses, liquidation is almost certain.

The company came within inches of giving up on negotiations to sell itself in a bankruptcy auction in mid-January, Sears board member William Transier testified Monday.

A board committee formed to negotiate and evaluate offers for Sears sent representatives to the judge’s chambers on Jan. 15 to notify him that they were unable to come to an agreement.

But Drain told the company to try to reach a final deal because it was his “very strong” preference to save as many jobs as possible, Transier said.

With those marching orders, ESL and Sears continued talks and reached an accord early on Jan. 16, Transier testified.

“The days ran together, and I was there the entire time,” Transier said to laughter in the courtroom.

During Monday’s hearing, attorneys for the committee of unsecured creditors – which includes major mall owners like Simon Property Group that want Sears to go out of business –pelted Sears representatives with questions seeking to undermine the company’s case to sell itself.

But Judge Drain, who will make the final decision, appeared visibly annoyed at times with that line of questioning and interjected on multiple occasions with comments questioning the relevancy of those inquiries.

The courtroom showdown may mark the dramatic finale to a years-long saga in which Sears, once the nation's largest and most influential retailer, unraveled amid massive debt, more nimble rivals and a shopping public that has mostly moved on.

Drain will decide whether Sears can be sold to ESL, continuing as a vastly smaller company with roughly 400 stores and 45,000 employees, or goes out of business.

Lampert has long faced criticism that he's capitalized on the complicated financial transactions he's executed to keep Sears afloat. USA TODAY reported in June that Lampert was receiving up to $220 million a year in loan payments from the retailer, which also owns Kmart, and had structured loans to guarantee that his hedge fund gained access to key assets.

More Money:Is Eddie Lampert set to 'steal' Kenmore brand? Courtroom clash will decide fate of Sears

More Money:Sears, Kmart may survive: Eddie Lampert wins Chapter 11 bankruptcy auction

More Money:Sears bid challenged by creditors who say chairman stripped company to enrich himself

Meanwhile, Sears has shuttered more than 3,500 stores and slashed roughly 250,000 jobs in roughly the last 15 years. In October, the company filed for Chapter 11 bankruptcy protection.

ESL has vigorously denied allegations that it was undermining Sears, saying that the actions it took were done "in good faith,'' with the goal of benefiting all of the company's stakeholders.

The court may not want to quash a deal that could be the only way a company that provides thousands of jobs is able to stay in business.