Elon Musk Tesla Model X
Tesla settled a lawsuit from the widow of an Apple engineer after his Model X SUV crashed into a highway divider and ignited five years ago. (Photo : Justin Sullivan/Getty Images)

Tesla has settled a lawsuit brought by the widow of an Apple engineer whose Model X compact SUV steered itself into a highway divider and burst into flames five years ago.

The terms of the agreement, reached a day before the case was set to go to trial, weren't disclosed.

In a court filing Monday, Tesla said it struck the deal to end "years of litigation," according to the Associated Press.

Walter Huang, 38, was killed on March 23, 2018, after he dropped his son off at preschool and headed for his job at Apple.

About 20 minutes after Huang activated the vehicle's "Autopilot" feature, it veered out of its lane and accelerated before smashing into a barrier in Mountain View, California, while going more than 70 mph.

Huang's widow, Sevonne Huang, sued Tesla the following year for unspecified damages on behalf of herself and the couple's two children, now 12 and 9 years old.

The lawsuit alleged wrongful death and negligence based on allegations that the marketing of Autopilot led drivers to believe they didn't have to pay attention to the road.

It also said Walter Huang's 2017 Model X "lacked a properly designed system for crash avoidance," according to the Mercury News.

Federal investigators said Walter Huang was likely distracted by a video game on his iPhone but his family's lawyers said there was no proof he was playing the game at the time of the crash.

Autopilot has come standard with every Tesla sold since the feature was introduced in 2015, according to the Mercury News.

The basic version provides cruise control and "Autosteer" for highways but an enhanced version includes automated lane changes, active navigation, and automated parking.

In December, Tesla recalled nearly all 2 million of its vehicles in the U.S. to update the Autopilot software so drivers get more warnings when they don't pay attention while using Autosteer.

The move followed a two-year federal probe of about 1,000 crashes that occurred while Autopilot was engaged.