The first known fatality from a self-driving car accident occurred earlier this year, Tesla revealed Thursday.

On May 7, 40-year-old Navy veteran Josh Brown was killed when his 2015 Model S Tesla collided with a tractor-trailer while in self-driving mode. Brown had a YouTube channel with more than a dozen videos of his car, which he nicknamed Tessy, driving on its own, including one in which it swerves to avoid a collision. 

The accident underscores remaining safety concerns about self-driving cars as major companies like Google and Uber race to perfect the technology, which is generally expected to be more safe than traditional vehicles. It's been estimated that there will be 20 million self-driving cars on the road by 2020. 

Tesla's self-driving technology is still being developed, and the company said in a blog post addressing the accident that it automatically disables Autopilot mode and requires drivers to acknowledge it's in beta mode before it can be enabled. The car also contains technology that encourages drivers to put their hands on the wheel in Autopilot mode, and slows the vehicle down if they don't. 

The crash likely occurred because the car was unable to sense the white side of the approaching trailer against a brightly lit sky, the company said. Had the collision been in the front or rear of the trailer rather than the side, the car's crash safety system would have likely prevented serious injury.

The National Highway Traffic Safety Administration has opened a formal investigation into the incident. Tesla noted that accidents with self-driving cars are still rare: This was the first fatality in an autopilot vehicle in 130 million miles, while the US has a rate of one fatality every 94 million miles for non-autonomous vehicles.

"Autopilot is getting better all the time, but it is not perfect and still requires the driver to remain alert," Tesla said. "Nonetheless, when used in conjunction with driver oversight, the data is unequivocal that Autopilot reduces driver workload and results in a statistically significant improvement in safety when compared to purely manual driving."