Tesla Inc. on Thursday reached an agreement to settle a class-action lawsuit with buyers of its Model S and Model X cars who alleged that the company's assisted-driving Autopilot system was "essentially unusable and demonstrably dangerous."

The lawsuit said Tesla misrepresented on its website that the cars came with capabilities designed to make highway driving "safer."

The Tesla owners said they paid an extra $5,000 to have their cars equipped with the Autopilot software with additional safety features such as automated emergency braking and side collision warning.