Two wannabe ISIS terrorists planned an attack involving a self-driving car — because they didn’t want to blow themselves up, British prosecutors said Tuesday.

Farhad Salah and Andy Star were busted in England in December for allegedly plotting the car-bomb attack, the Telegraph reported.

“The prosecution allege that Farhad Salah and Andy Star had decided that improvised explosive devices could be made and used in a way here in the UK that spared their own lives preferably but harmed others they considered to be infidels,” prosecutor Anne Whyte said in opening statements in Sheffield Crown Court, where the pair went on trial.

ISIS has been developing a driverless car bomb since at least 2016. An instructional video obtained by Sky News showed remote-controlled vehicles loaded with mannequins with self-regulation thermostats — that mimic human body heat — to bypass scanning devices that protect government and military buildings.

Salah, 23, allegedly sent a message to a pal admitting his ultimate goal.

“My only attempt is to find a way to carry out martyrdom operation with cars without driver. Everything is perfect. Only the program is left,” he wrote in December, Whyte told the court.

Other messages on social media showed Salah’s “affiliation to [the] Islamic State,” the prosecutor said.

In November, he shared a nearly hour-long propaganda video showing war scenes, beheadings and executions. He also allegedly offered to send funds to a member of a Salafist jihadist militant group.

Salah entered the UK in 2014, but there had been no ruling on his asylum claim prior to his arrest.

Star, 32, meanwhile, had access to the materials needed to build an explosive device and was making them in his apartment in Chesterfield, authorities said.

“It is entirely conceivable that Andy Star’s extreme views developed a relatively short time before the events with which we are now concerned,” said Whyte.

Police recovered three air rifles, two Samurai swords, a wine bottle full of sulfuric acid, homemade fireworks and a “variety of improvised homemade fuses” from Star’s home, Whyte said. They also found gunpowder and a “viable pyrotechnic fuse.”

The two men, who are charged with preparing an act of terrorism, have denied the allegations. Their trial is expected to last four weeks.