Tesla has settled a lawsuit over a 2018 car crash that killed an Apple engineer after his Model X, operating on Autopilot, swerved off a highway near San Francisco, court documents showed on Monday.

The settlement was made on the eve of the trial over the high-profile accident involving Tesla's driver-assistant technology. Tesla faces a series of lawsuits over crashes related to the alleged use of Autopilot, putting the automaker at risk of large monetary judgments and reputational damage.

The settlement, the terms of which were not disclosed, came as Chief Executive Elon Musk is making major promotions of self-driving technology, which he has touted as key to the financial future of the world's most valuable automaker.

The 2018 accident killed 38-year-old Walter Huang. His family had alleged that Autopilot steered his 2017 Model X into a highway barrier. Plaintiffs' lawyers asked a Tesla witness whether the company knew drivers would not watch the road when using its driver-assistance system, Reuters reported last month citing deposition transcripts.

Tesla had contended that Huang misused the Autopilot system because he was playing a video game just before the accident.

Huang's lawyer and Tesla were not available for comment.

The crash that killed Huang is among hundreds of U.S. accidents in which Autopilot was a suspected factor in reports to auto safety regulators.

The U.S. National Highway Traffic Safety Administration has examined at least 956 crashes in which Autopilot was initially reported to have been in use. The agency separately launched more than 40 investigations into accidents involving Tesla automated-driving systems that resulted in 23 deaths.

"It is striking to me that Tesla decided to go this far publicly and then settle," said Bryant Walker Smith, a law professor at the University of South Carolina with expertise in autonomous vehicle law. "What this does do, though, is it says to other attorneys, we might settle. We might not always fight it. That is the signal."

The case follows two previous California trials over Autopilot that Tesla won by arguing the drivers involved had not heeded its instructions to maintain attention while using the system.

Tesla has yet to prove it can produce an autonomous car despite years of predictions by co-founder and CEO Musk that one was just around the corner, an expectation that partly underpinned Tesla's soaring valuation.

Musk said on Friday that Tesla plans to unveil a self-driving robotaxi on Aug. 8, after Reuters reported that Tesla scrapped an inexpensive car plan in favor of robotaxis.

He also said last month that Tesla will offer U.S. customers a month's free trial of its driver-assist technology, Full Self-Driving.

Any negative publicity threatens to hurt the reputation of Tesla at a time when the company is battling weakening sales and reputational damage caused by certain controversial comments from Musk, said Guidehouse Insights analyst Sam Abuelsamid.

"The last thing they would want right now is to have a public trial showing all of the problems with Full Self-Driving," he added.

Tesla says Autopilot can match speed to surrounding traffic and navigate within a highway lane. The step-up "enhanced" Autopilot, which costs $6,000, adds automated lane-changes, highway ramp navigation and self-parking features. The $12,000 Full Self-Driving option adds automated features for city streets, such as stop-light recognition.

Tesla materials explaining the systems warn that it does not make the car autonomous and requires a "fully attentive driver" who can "take over at any moment."

Musk said in a social media post in 2022: "We will never surrender/settle an unjust case against us, even if we will probably lose."

(Reporting by Abhirup Roy in San Francisco and Aditya Soni in Bengaluru, additional reporting by Hyunjoo Jin in San Francisco; Editing by Krishna Chandra Eluri, Lisa Shumaker, Leslie Adler and Himani Sarkar)