Hertz Global Holdings Inc. has struck a deal that will cut the debt it owes lenders who financed its rental car fleet to less than $5 billion from $11 billion by Dec. 31, the company’s main bankruptcy lawyer said in court Friday.

Under an agreement with the lenders, Hertz has agreed to sell 182,000 cars over the next few months, Tom Lauria told U.S. Bankruptcy Judge Mary Walrath. The deal requires Hertz to make $650 million in lease payments. The reduction in the $11 billion in vehicle debt is tied to the auto sales, Lauria said.

The deal “took a little bit of good luck,” he said, referring to a boost in the used car market that began in the last few months.

Hertz and its vehicle lenders had been fighting about how much the company owed under a lease contract that governs the fleet. Lawyer Marshall Huebner said the lenders he represents believe they were owed $1.8 billion in regular payments through Dec. 31 under that lease. Hertz and lower-ranking creditors have maintained the amount was far less.

“I do like to see peace break out,” Walrath said in approving the settlement.

The case is Hertz Corp. 20-11218, U.S. Bankruptcy Court, District of Delaware (Wilmington).