(Bloomberg) -- Bankrupt electric-vehicle maker Lordstown Motors Corp. has agreed to pay $40 million to settle a Karma Automotive LLC lawsuit alleging that the company lifted designs and technology to develop its flagship Endurance truck.

The settlement disclosed in bankruptcy court papers Tuesday averts an upcoming trial that threatened to derail Lordstown’s efforts to sell its business in Chapter 11.

The deal is for substantially less than the more than $900 million Karma had been seeking, but it ensures Karma is compensated despite Lordstown’s bankruptcy. Lordstown said that while it still disputes Karma’s allegations, a settlement was necessary to avert a costly and time-consuming jury trial that posed a “significant impediment” to its sale process and risked scaring off potential bidders.

The deal was struck weeks after Judge Mary Walrath ruled Lordstown would have to go to trial over Karma’s allegations despite the fact that the company recently filed Chapter 11, an action that usually pauses litigation. The outcome of a trial was expected to determine which company owns assets related to the Endurance, meaning the dispute could have determined what potential bidders could actually acquire from Lordstown.

The $40 million settlement must be approved by Judge Walrath. The settlement amount includes a $5 million royalty payment, according to court documents.

Lordstown filed Chapter 11 in June amid a separate, costly dispute with iPhone maker Foxconn Technology Group over a deal to make pickup trucks for Lordstown at an assembly plant in Ohio.

The bankruptcy is Lordstown Motors Corp., 23-10831, US Bankruptcy Court for the District of Delaware.

©2023 Bloomberg L.P.