Four days before Walter Huang’s Tesla veered off U.S. Highway 101 in Northern California and into a concrete barrier, killing the father of two, Huang sent a text message describing the car’s “Autopilot” system making a similar error in the same spot, according to documents released Tuesday by federal investigators.

Investigators with the National Transportation Safety Board, using data recorded by Huang’s 2017 Tesla Model X, “confirmed that the Tesla Autosteer system made a left steering movement toward” the area on March 19, 2018. Huang had his hands on the steering wheel at the time and “made a right corrective steering movement” within one second, according to the NTSB.

Huang told relatives that his car had tried to steer off the road multiple times before in the same place, according to NTSB interviews. “The family explained that it happened so often that he had told both his brother and his wife about the problem,” according to the NTSB.

But on March 23, after Huang dropped his son off at preschool and headed toward his office, he used his iPhone 8 while behind the wheel, according to the NTSB. Recovered phone logs show that a strategy game called “Three Kingdoms” was “active during the driver’s trip to work,” the NTSB said. Investigators said the log data “does not provide enough information to ascertain” whether Huang “was holding the phone or how interactive he was,” though it said “most players have both hands on the phone to support the device and manipulate game actions.” Huang’s data usage was “consistent” with online game activity “about the time of the crash,” according to the NTSB.

When Huang’s Tesla SUV reached the exit ramp area in Mountain View, where he said the problems previously occurred, the car again steered out of its lane and hit a barrier at about 71 miles per hour, according to the NTSB.

Tesla did not immediately respond Tuesday to questions about the Autopilot flaw Huang described or whether it had been fixed.

During the final minute of the trip, Huang’s hands were detected on the steering wheel “on three separate occasions, for a total of 34 seconds,” the NTSB previously reported. For the six seconds before the crash, “the vehicle did not detect the driver’s hands on the steering wheel.” In its final seconds, the car also sped up from 62 mph, investigators said.

Huang had Autopilot on for nearly 19 minutes before the crash, and the system detected that his hands were not on the wheel 34 percent of that time, according to the newly released NTSB documents. The system gave him two “visual alerts” and an audible one during that time, the documents say.

“The driver sustained fatal injuries and was unable to be interviewed regarding potential in-vehicle distractions,” the NTSB said.

Tesla has faced sharp criticism from some lawmakers in Congress and elsewhere for calling its driver assistance features “Autopilot,” which critics say is an overstatement of the system’s capabilities and can encourage customers to let their guard down. The features are supposed to keep the car in its lane and apply the brakes in an emergency, but Tesla tells drivers they need to keep their hands on the wheel and stay in control of the vehicle.

Huang’s wife “remembered the salesperson informing him the Autopilot system was not fully autopilot yet because of the ‘government,’” according to the NTSB documents. “She also remembered him being informed that the driver needed to keep his hands on the steering wheel while using Autopilot.”

Tesla, responding to questions from Sen. Edward J. Markey (D-Mass.) in December, provided data indicating that its customers who use Autopilot are significantly less likely to crash.

“Tesla takes the risk of improper use or abuse of Autopilot very seriously. Making sure the driver is attentive and able to take over at any time is a cornerstone of our feature development and validation, and something we continue to improve through fleet learning, customer feedback, and over-the-air (‘OTA’) updates,” the company wrote.

The NTSB will hold a meeting later this month to determine the probable cause of Huang’s crash.

Federal investigators Tuesday also released information on a second deadly crash, in 2019, as a driver used Autopilot in Delray Beach, Fla. In that crash, a tractor trailer drove out from a private driveway and slowed in the middle of a highway, blocking the Tesla’s path, federal investigators said.

Neither the Tesla driver, Jeremy Banner, nor the Autopilot system “executed evasive maneuvers,” and the car’s roof sheared off as it drove under the truck, according to the NTSB.

The speed limit was 55 mph. Banner set the “Traffic Aware Cruise Control,” part of Autopilot, at 69 mph about 12 seconds before the crash, investigators said. He activated “Autosteer” about 10 seconds before the crash. His hands were not detected on the wheel during the final 7.7 seconds before impact, the NTSB said.

Banner’s wife, Kim, told investigators that Banner was “always engaged and alert” while using Autopilot, according to the NTSB’s account of the interview. She said he bought the Tesla Model 3 after years of research, “because it combined two of his passions — cars and computers.”