A Tesla Model S Plaid erupted in flames as the owner was driving down the road on Tuesday, attorneys for the man said, briefly trapping him in the car after the electronically activated doors would not open.

It happened outside Philadelphia days after the man took delivery of the model that Tesla has hailed as the world’s quickest production car. Tesla said it delivered the first 25 vehicles in June after its CEO, Elon Musk, held a glitzy media event in Fremont, Calif.

Authorities from the Gladwyne Fire Department initially said they were investigating a fire involving a Tesla Model S, but by Thursday the news release had been taken down.

Charles McGarvey, chief fire officer of the Lower Merion Township Fire Department, confirmed to The Post on Friday morning that there was a fire Tuesday involving a Tesla Model S Plaid and that it took more than two hours to extinguish.

Authorities arrived to find the car engulfed in flames, he said.

“With the Teslas, you’ve got to just put copious amounts of water on it,” he said. “After that, you’ve got to sit 45 minutes, an hour, [and] once it stops smoking you can release it to second responders. We had it towed to a location that was secured.” McGarvey had first confirmed to CNBC that a 2021 Model S Plaid caught fire on Tuesday night.

Tesla did not immediately respond to a request for comment.

The National Highway Traffic Safety Administration said it is gathering information on the incident.

“NHTSA is aware of the Tesla vehicle fire in Gladwyne, Pennsylvania; and the agency is in touch with relevant agencies and the manufacturer to gather information about the incident,” spokeswoman Lucia Sanchez said. “If data or investigations show a defect or an inherent risk to safety exists, NHTSA will take action as appropriate to protect the public.”

The agency is investigating alleged defects that can cause fires in Tesla sedans and SUVs, including older Model S and Model X vehicles, a probe that was opened in 2019.

The blaze bore a resemblance to previous Tesla fires, where there was an electrical or smoky smell followed by a pop, and the owner became trapped in the vehicle after its electronics malfunctioned. The Washington Post reported on a similar series of events in Frisco, Tex., in November.

Attorneys for the driver, who they declined to identify, shared photos of badging and documentation confirming the vehicle was a Model S Plaid and said it had been delivered the weekend before the incident.

Mark Geragos, of the law firm Geragos and Geragos, confirmed he is representing the owner and called for Tesla to take the vehicles off the road.

“This is a harrowing and frightening situation and an obvious major problem,” Geragos said in a statement. “Our preliminary investigation is ongoing, but we call on Tesla to sideline these cars until a full investigation can occur.”

Geragos is working with another attorney, Jason Setchen, who is representing the owner through his business Athlete Defender.

In an interview, Setchen said his client narrowly escaped catastrophe after the car caught fire and the door handles would not budge.

“He’s in the car, he smells and sees the smoke, turns around and sees the smoke is filling up the cabin, then flames, and reacts almost immediately,” Geragos said in an interview. “The door malfunctions, he gets out and somehow the car is still running [down the road] according to witnesses as he’s trying to get away from the car. And within moments of him getting out of the car, the car is engulfed in flames.”

Setchen said the owner had been driving the car around 8:55 p.m. Tuesday when the fire broke out.

“Once he saw the fire shoot out of the back, that’s when he immediately pulled over to try to exit the vehicle,” Setchen said. “He tried to get out of the vehicle; he was pushing the door frantically and it would not engage.”

Finally, he said, the owner put the weight of his body against the door.

“He was able to push the button again and lean against the door very hard and that’s when it opened up,” he said.

The attorneys were continuing to investigate the incident and would review their options once the probe was complete. They said they planned to formally alert NHTSA of the problem, in case it affected more vehicles.

Tesla has hailed the vehicle as an engineering marvel, promising a 390-mile range and more than 1,000 horsepower, propelling the car to speeds up to 200 mph and logging 0-to-60-mph times of below 2 seconds. The fire involving one of the few Plaid models already in the hands of customers raises questions about long-simmering concerns about Tesla’s approach to electrification, which involves different battery chemistry from competitors and maximizing range and performance compared with that of rivals.