The first person to die in a US crash involving a car in self-driving mode was the tech-savvy 40-year-old owner of a Tesla Model S who nicknamed his car "Tessy" and praised its sophisticated "Autopilot" system.
Joshua Brown, of Canton, Ohio, died in the May 7 crash in Williston, Florida, when his car's cameras failed to distinguish the white side of a turning tractor-trailer rig from a brightly-lit sky and did not automatically activate its brakes, according to US government records and a Tesla statement.
Just one month earlier Mr Brown, who owned a technology company, credited his 2015 Tesla with preventing a crash on an interstate highway. The government said it was investigating the design and performance of the Tesla system.
Frank Baressi, 62, the driver of the tractor-trailer and owner of Okemah Express, said the Tesla driver was "playing Harry Potter on the TV screen" and driving so quickly that "he went so fast through my trailer I didn't see him".
"It was still playing when he died and snapped a telephone pole a quarter mile down the road," Mr Baressi said from his home in Palm Harbour, Florida.
He acknowledged he could not see the movie, only heard it, but Tesla Motors said it was not possible to watch videos on the Model S touchscreen.
Brown's published obituary described him as a member of the Navy SEALs for 11 years and founder of a wireless Internet network and camera system company. In Washington, the Pentagon confirmed Brown's work with the SEALs and said he left the service in 2008.
In April, Mr Brown said his car avoided a crash when a commercial truck swerved into his lane. He published a video of the incident online.
Tesla noted that drivers must manually enable the Autopilot system, saying: "Autopilot is getting better all the time, but it is not perfect and still requires the driver to remain alert."
As the National Highway Traffic Safety Administration opened an investigation, Tesla founder Elon Musk expressed condolences in a tweet for the "tragic loss".
Preliminary reports indicate the crash occurred when Mr Baressi's rig turned left in front of Mr Brown at a junction of a divided highway where there were no traffic lights, the NHTSA said. Mr Brown died at the scene just south west of Gainesville.
By the time firefighters arrived, the Tesla wreckage - with its roof sheared off - had come to rest hundreds of feet from the crash site.
Tesla said in a statement that this was the first known death in more than 130 million miles of Autopilot operation.
Before Autopilot can be used, drivers have to acknowledge that the system is an "assist feature" that requires both hands on the wheel. Drivers are told they need must be prepared to take over controls, the statement said.
Autopilot checks to make sure a driver's hands are on the wheel, and it gives visual and audible alerts if they are not. It also will gradually slow the car until the driver responds, the statement said.
The system allows the Model S to steer itself within a lane, change lanes and speed up or slow down based on surrounding traffic or the driver's set speed. It can automatically apply brakes and slow the vehicle.
Tesla said Autopilot "results in a statistically significant improvement in safety".
Mr Brown's death comes as the NHTSA is taking steps to ease self-driving cars on to US roads, an anticipated sea-change in driving where Tesla has been a leader. Self-driving cars are expected to eliminate human errors that are responsible for 94% of crashes.
It is not the first time automatic braking systems have malfunctioned and several have been recalled to fix problems.
Last year Ford recalled 37,000 F-150 pick-ups because they braked with nothing in the way. The company said the radar could become confused when passing a large, reflective truck.
The technology relies on multiple cameras, radar, laser and computers to sense objects and determine if they are in the car's way.
Systems like Tesla's, which rely heavily on cameras, "aren't sophisticated enough to overcome blindness from bright or low contrast light," said Mike Harley, an analyst at Kelley Blue Book.
Mr Harley said more deaths could be expected as the autonomous technology was refined.
Karl Brauer, a senior analyst with Kelley Blue Book, said the crash was a huge blow to Tesla's reputation.
"They have been touting their safety and they have been touting their advanced technology," he said. "This situation flies in the face of both."