Faraday now has a chance to rebuild after layoffs and a nasty legal battle.

The soap opera-like saga of Faraday Future has taken a positive turn. The electric car startup has settled a dispute with its largest investor, Chinese real estate conglomerate Evergrande, according to a statement posted to the Hong Kong Stock Exchange. Needless to say, it's a rare piece of good news for the beleaguered Faraday.

Under the terms of the deal, Evergrande will restructure its $2 billion investment in Faraday, and will gain control of the startup's Chinese operations. Faraday will also receive a bridge loan to address its current cash shortage, reports The Verge. The startup resorted to layoffs to stay afloat while it battled Evergrande. It also lost a number of executives, including co-founder Nick Sampson.

Evergrande has also agreed to release control over Faraday's assets, which were considered collateral under the original investment deal, according to The Verge. Faraday previously argued that Evergrande was blocking its attempts to secure new investments by refusing to release control of these assets. Without any products or revenue, Faraday needed the assets as collateral. The deal also reduces Evergrande's stake in Faraday from 45 percent to 32 percent, and Faraday has the option to buy back Evergrande's stake in five years.

The $2 billion investment from Evergrande originally seemed like a vital lifeline for Faraday, which had struggled financially after its main patron, Chinese entrepreneur Jia Yueting, became unable to keep the nascent automaker afloat following the collapse of his LeEco tech company. But relations between Faraday and Evergrande quickly soured.

Evergrande gave Faraday $800 million in early 2018, and the startup seemed to make progress in getting its FF 91 electric SUV into production. But Faraday soon asked for an advance on Evergrande's next payment. Evergrande, claiming Faraday hadn't met certain benchmarks for the payment, refused. Faraday took Evergrande to arbitration in Hong Kong, and began working to sever ties with the Chinese firm.

It was later revealed that one point of contention was Jia Yueting's continued involvement with Faraday. Jia, who has racked up significant debts in his home country, had agreed to distance himself from Faraday, per Evergrande's wishes. But Evergrande argued that Jia hadn't done enough to separate himself from the startup.

With the investment dispute seemingly resolved, Faraday can now concentrate on getting the FF 91 into production. Unveiled to much fanfare at the 2017 Consumer Electronics Show (CES), the FF 91 boasts a claimed 1,050 horsepower and a 378-mile range. But Faraday's various mishaps, have repeatedly pushed back the electric car's launch.