DETROIT (AP) — Tesla is recalling nearly all vehicles sold in the U.S., more than 2 million, to update software and fix a defective system that’s supposed to ensure drivers are paying attention when using Autopilot.

Documents posted Wednesday by U.S. safety regulators say the update will increase warnings and alerts to drivers and even limit the areas where basic versions of Autopilot can operate.

The recall comes after a two-year investigation by the National Highway Traffic Safety Administration into a series of crashes that happened while the Autopilot partially automated driving system was in use. Some were deadly.

The agency says its investigation found Autopilot’s method of making sure that drivers are paying attention can be inadequate and can lead to “foreseeable misuse of the system.”

The added controls and alerts will “further encourage the driver to adhere to their continuous driving responsibility,” the documents said.

But safety experts said that, while the recall is a good step, it still makes the driver responsible and doesn’t fix the underlying problem that Tesla’s automated systems have with spotting and stopping for obstacles in their path.

The recall covers models Y, S, 3 and X produced between Oct. 5, 2012, and Dec. 7 of this year. The update was to be sent to certain affected vehicles on Tuesday, with the rest getting it later.

Shares of Tesla slid more than 3 percent in earlier trading Wednesday but recovered amid a broad stock market rally to end the day up 1 percent.

The attempt to address the flaws in Autopilot seemed like a case of too little, too late to Dillon Angulo, who was seriously injured in 2019 crash involving a Tesla that was using the technology along a rural stretch of Florida highway where the software isn’t supposed to be deployed.

“This technology is not safe, we have to get it off the road,” said Angulo, who is suing Tesla as he recovers from injuries that included brain trauma and broken bones. “The government has to do something about it. We can’t be experimenting like this.”

Autopilot includes features called Autosteer and Traffic Aware Cruise Control, with Autosteer intended for use on limited access freeways when it’s not operating with a more sophisticated feature called Autosteer on City Streets.

The software update will limit where Autosteer can be used. “If the driver attempts to engage Autosteer when conditions are not met for engagement, the feature will alert the driver it is unavailable through visual and audible alerts, and Autosteer will not engage,” the recall documents said.

According to recall documents, agency investigators met with Tesla starting in October to explain “tentative conclusions” about the fixing the monitoring system. Tesla did not concur with NHTSA’s analysis but agreed to the recall on Dec. 5 in an effort to resolve the investigation.

Auto safety advocates for years have been calling for stronger regulation of the driver monitoring system, which mainly detects whether a driver’s hands are on the steering wheel. They have called for cameras to make sure a driver is paying attention, which are used by other automakers with similar systems.

Philip Koopman, a professor of electrical and computer engineering at Carnegie Mellon University who studies autonomous vehicle safety, called the software update a compromise that doesn’t address a lack of night vision cameras to watch drivers’ eyes, as well as Teslas failing to spot and stop for obstacles.

“The compromise is disappointing because it does not fix the problem that the older cars do not have adequate hardware for driver monitoring,” Koopman said.

Koopman and Michael Brooks, executive director of the nonprofit Center for Auto Safety, contend that crashing into emergency vehicles is a safety defect that isn’t addressed. “It’s not digging at the root of what the investigation is looking at,” Brooks said. “It’s not answering the question of why are Teslas on Autopilot not detecting and responding to emergency activity?”

Koopman said NHTSA apparently decided that the software change was the most it could get from the company, “and the benefits of doing this now outweigh the costs of spending another year wrangling with Tesla.”

In its statement Wednesday, NHTSA said the investigation remains open “as we monitor the efficacy of Tesla’s remedies and continue to work with the automaker to ensure the highest level of safety.”

Autopilot can steer, accelerate and brake automatically in its lane, but is a driver-assist system and cannot drive itself, despite its name. Independent tests have found that the monitoring system is easy to fool, so much that drivers have been caught while driving drunk or even sitting in the back seat.

In its defect report filed with the safety agency, Tesla said Autopilot’s controls “may not be sufficient to prevent driver misuse.”

A message was left early Wednesday seeking further comment from the Austin, Texas, company.

Tesla says on its website that Autopilot and a more sophisticated Full Self Driving system are meant to help drivers who have to be ready to intervene at all times. Full Self Driving is being tested by Tesla owners on public roads.

In a statement posted Monday on X, formerly Twitter, Tesla said safety is stronger when Autopilot is engaged.

NHTSA has dispatched investigators to 35 Tesla crashes since 2016 in which the agency suspects the vehicles were running on an automated system. At least 17 people have been killed.

The investigations are part of a larger probe by the NHTSA into multiple instances of Teslas using Autopilot crashing into emergency vehicles. NHTSA has become more aggressive in pursuing safety problems with Teslas, including a recall of Full Self Driving software.

In May, Transportation Secretary Pete Buttigieg, whose department includes NHTSA, said Tesla shouldn’t be calling the system Autopilot because it can’t drive itself.

—-

AP Technology Writer Michael Liedtke contributed to this story.