Joshua Neally’s brand-new Tesla Model X didn’t exactly save his life when he started having severe chest pains, but it helped him get most of the way to a hospital.

The 37-year-old was driving in his electric car from his law office in Springfield,Missouri, when the air was sucked from his lungs and he felt a sudden biting pain in his chest – a blocked artery in his lungs. Distracted by the pain and still in traffic, he let the car’s controversial autopilot carry him down the road toward a hospital.

“It was the most excruciating pain I’ve ever had,” he later told local KY3 news. “It was kinda getting scary. I called my wife and just said, ‘Something’s wrong.’”

“I just knew I had to get there, to the ER,” he said.

Tesla’s autopilot function requires a driver to touch the wheel every few minutes, and Neally was able to keep it active for 20 miles down the highway. He said that in the moment of crisis, he considered stopping for an ambulance but decided to trust the software, for fear that he would crash if the car were entirely in his control. Tesla’s software has been designed to guide cars to a stop on the side of the road if a driver stops responding.

“If something like that happens where I become unconscious or incapacitated while I’m driving,” he said, “I’m not going to cross over the interstate and slam into somebody or slam into one of the big rock walls.”

Eventually carried near a hospital, Neally gathered his strength and took over, driving off the highway exit ramp and the rest of the way to the hospital. He has since recovered and continues to receive treatment.

Neally declined to be interviewed when contacted by the Guardian, saying: “I’m a tad overwhelmed by the attention.”

Tesla did not respond to a request for comment.

In May, a Florida man was killed while driving a Tesla on autopilot, with a DVD of Harry Potter on, according to a witness. According to Tesla, the car’s sensors failed to detect a white 18-wheel truck against a bright sky, and the car attempted to drive underneath the tractor-trailer “with the bottom of the trailer impacting the windshield of the Model S”.

On 1 July, a Model X on autopilot on a Pennsylvania highway crashed into a guardrail, drove across several lanes and flipped on to a roof. The man behind the wheel was later charged with careless driving. A third Tesla also crashed in Montana that month, in another nonfatal crash, and the company said that data suggested the driver’s hands were off the wheel for more than two minutes, in violation of the autopilot terms of use.

Neally acknowledged those questions, saying: “It’s not going to be perfect, there’s no technology that’s perfect, but I think the measure is that it’s better and safer.”

The crashes have raised questions over the safety of Tesla’s autopilot function, and the fatal Florida crash prompted a federal investigation. The Securities and Exchange Commission also reportedly opened an investigation into whether Tesla, which disclosed the crash in July, should have noted it in an earlier regulatory filing.

Tesla CEO Elon Musk has defended his embattled company’s safety record, and in April he asserted that the autopilot system was “twice as good as a person”. In July, he responded to criticisms of the autopilot, saying: “When used correctly, it is already significantly safer than a person driving by themselves and it would therefore be morally reprehensible to delay release simply for fear of bad press or some mercantile calculation of legal liability.”

Musk has also cited the dire traffic accident statistics, noting that the July crash was “the first known fatality in just over 130m miles” in contrast to 1.25m people who die in car accidents each year.

The autopilot function is not fully autonomous, like self-driving cars being developed by Google and other companies. The company also calls the technology a “beta” feature still in testing.