A Tesla on autopilot has nearly crashed in the same location where an Apple engineer, 38, died just weeks ago after his Model X crashed into a barrier.

A video of the terrifying incident shows the Tesla starting to veer to the left and into the divider - without warning the driver.

Tesla says the vehicle involved in last month's fatal crash was operating on autopilot, the latest accident to involve self-driving technology.

A Tesla on autopilot (pictured) has nearly crashed in the same location where an Apple engineer, 38, died just weeks ago after his Model X crashed into a barrier

Driver Shantanu Joshi was testing out what his Tesla would do on autopilot on Highway 101, near Highway 85, by Mountain View.

'I low key freaked out, but the car definitely starts swerving left without giving me any warnings, right into that divider,' Mr Joshi told CBS.

From the video it appears the white lanes were faded so the car thought the left side of the lane was on the right.

'The lanes are not marked clearly on the road, so the camera attached to the Tesla vehicle is having a difficult time', Fred Barez, a professor of mechanical engineering at San Jose State University told the programme.

'Tesla believes in having eight cameras all around the vehicle and they monitor the presence of the lanes on the road.'

On the company's website it says the company are now using a dozen ultrasonic sensors.

Driver Shantanu Joshi (pictured) was testing out what his Tesla would do on autopilot on Highway 101, near Highway 85, by Mountain View

From the video it appears the white lanes were faded so the car thought the left side of the lane was on the right

Tesla says the vehicle involved in last month's fatal crash - also near Mountain View (pictured) was operating on autopilot, the latest accident to involve self-driving technology

This means cars are able to detect objects that are nearly twice as far away.

The company also says users must keep their hands on the wheel. According to the video the driver in the deadly crash did not take hold of it, despite warnings.

In this latest video where catastrophe was narrowly avoided, the driver takes control of the wheel just before the car would have crashed.

MailOnline has contacted Tesla for comment.

Just a few days ago an unidentified driver tried something similar.

He filmed himself using Tesla's semi-autonomous driving feature as he drove in his Model S down a Chicago freeway.

He chose an almost identical section of road in Chicago to try and investigate how the recent fatal crash on a California highway unfolded.

The crash happened in Mountain View, in California's Silicon Valley. The driver was Walter Huang, 38, a software engineer for Apple

The footage showed the vehicle travelling 59 mph for the majority of the highway before an alert to 'hold the steering wheel' started flashing as he approached a fork in the road.

The car headed straight in the direction of a barricade dividing the two roads.

The driver, who barely had time to react, managed to brake in time and came to a stop just short of the barrier.

Electrek reports that the autopilot's autosteer feature seemingly remained locked on the left line despite even as it altered and became the right line of the ramp.

The technology may have been confused because the lines to the ramp were more clearly marked that the actual lane.

Tesla has now confirmed that the vehicle involved in the deadly crash on March 23 was operating on autopilot at the time.

The electric car maker said the driver, who was killed in the accident, did not have his hands on the steering wheel for six seconds before the crash, despite several warnings from the vehicle.

Tesla said its vehicle logs show the driver took no action to stop the Model X SUV from crashing into a concrete lane divider.

Tesla has confirmed that the vehicle involved in the deadly crash on March 23 was operating on autopilot at the time. Walter Huang, 38, died in the crash

The electric car maker said the driver, who was killed in the accident, did not have his hands on the steering wheel for six seconds before the crash, despite several warnings from the vehicle

WILL TESLA EVER RELEASE A CAR THAT CAN DRIVE ITSELF ACROSS THE COUNTRY? Billionaire tech mogul Elon Musk has claimed that a Tesla will soon be able to drive itself cross country. In 2016, Musk said that a Tesla would be able to drive itself from Los Angeles to New York. Year after year, he has has failed to deliver on that promise. Last August, Musk insinuated that the cross-country trip wouldn't be happening until 2018. 'It is certainly possible that I will have egg on my face on that front, but if it's not at the end of the year, it will be very close,' Musk said in a call with investors last year. Tesla has been inching closer to releasing a fully autonomous car. Its self-driving software, Autopilot, hasn't been without speed bumps, however. Advertisement

Photographs of the SUV show that the front of the vehicle was demolished; its hood was ripped off; and its front wheels were scattered on the freeway.

The vehicle also caught fire, though Tesla said no one was in the vehicle when that happened.

The company said the crash was made worse by a missing or damaged safety shield on the end of the freeway barrier that is supposed to reduce the impact into the concrete lane divider.

The crash happened in Mountain View, in California's Silicon Valley. The driver was Walter Huang, 38, a software engineer for Apple.

'None of this changes how devastating an event like this is or how much we feel for our customer's family and friends,' Tesla said on its website late Friday.

Tesla defended its Autopilot feature, saying that while it doesn't prevent all accidents, it makes them less likely to occur than vehicles without it.

Federal investigators are looking into last week's crash, as well a separate crash in January of a Tesla Model S that may have been operating under the Autopilot system.

The deadly crash and concerns about the company's ability to raise new capital also took a toll on stocks.