The sale of the Weinstein Co. to Lantern Capital looked like a done deal in May. But according to a new filing in bankruptcy court, the parties subsequently had a bitter clash over millions of dollars in profit participation payments, which almost scuttled the sale.

Lawyers for the Weinstein Co. announced in court on Friday that they had agreed to cut the sale price from $310 million to $287 million. A bankruptcy judge must still approve the change, which is strongly opposed by the Weinstein Co. creditors.

On Wednesday, the company filed a motion to approve the price reduction. In it, lawyers revealed that Lantern had threatened to back out of the deal unless the Weinstein Co. agreed to cover the disputed payments to various A-list actors and directors. For instance, Robert De Niro claims he is owed $940,706 for work on “Silver Linings Playbook.”

The Weinstein Co. threatened to sue Lantern for failing to live up to the terms of the purchase agreement, which provides that Lantern is responsible for the payments. Lantern, in turn, accused the Weinstein Co. of lying about the payments, and threatened to file its own countersuit.

On June 12, the Weinstein Co. sent Lantern a letter alleging that the private equity firm had breached the agreement by failing to close by June 7. On June 18, the Weinstein Co. demanded that Lantern commit to closing by June 30. Lantern replied on June 20, accusing the Weinstein Co. of breaching the agreement.

Andy Mitchell, the co-founder of Lantern, engaged in several rounds of talks with Robert Del Genio, the chief restructuring officer for the Weinstein Co. The result of those talks was an agreement to cut the purchase price by $23 million, while Lantern will assume responsibility for the participation payments. The sale is now expected to close by July 14.

In the motion, the Weinstein Co.’s attorneys acknowledge they are in a weak negotiating position. The company says that it does not have a viable backup bidder. It also does not have time to pursue litigation against Lantern. If the sale does not close soon, the company will run out of emergency financing and be forced to liquidate.

“The Parties’ disputes have come to a head at a perilous time for the Debtors,” wrote Weinstein Co. attorney Zachary Shapiro. “To put it bluntly, the Debtors are running out of both time and money. … Given this dire situation, the Debtors have used their best efforts to save the Sale.”

The creditors committee has accused the Weinstein Co. of caving to Lantern’s demands, and alleged that Lantern has inflated the alleged breaches. A hearing on the price cut is set for July 11 in Delaware.