Apple and advanced battery maker A123 Systems say they have nearly settled a federal lawsuit accusing Apple of poaching A123’s scientists and engineers to build a competing battery business.

The lawsuit, which was filed early this year, lifted the veil on the typically secretive inner workings at Apple. It has added fuel to news reports that Apple is researching the possibility of building an electric car, a project that Apple has not confirmed.

On Tuesday, a federal judge granted A123 more time to finalize the settlement with Apple. In a court filing, the two sides reported that they “have reached an agreement, signed a term sheet, and are in the process of drafting a final settlement agreement.”

Apple had hinted at a possible settlement in earlier court filings. News of the agreed-to settlement was first reported Tuesday by Xconomy.

In its original lawsuit, A123 said that former engineer Mujeeb Ijaz had violated an agreement not to raid A123’s employee ranks after joining Apple. Ijaz and four other former A123 employees were named as defendants in the lawsuit.

A123 alleged that Apple and Ijaz were “systematically hiring away A123’s high-tech PhD and engineering employees, thereby effectively shutting down various projects/programs at A123,” and that Apple was “currently developing a large scale battery division to compete in the very same field as A123.”

Apple had denied any wrongdoing in previous court filings, dismissing A123’s claims as “premised on baseless conjecture.”

The Apple lawsuit has provided another high-profile chapter in the long-winding saga of A123, a once-promising car-battery manufacturer that went public in 2009 but spiraled into bankruptcy after production missteps and a slowdown in the electric car market. A123 is now owned by China’s Wanxiang Group, which purchased the company out of bankruptcy for about $257 million in late 2012.

In early 2014, Wanxiang also purchased bankrupt electric-car maker Fisker Automotive — once a key A123 customer — and sold off A123’s electric-grid battery business in a bid to refocus on the auto industry.

A123 v. Apple Drafting Settlement