A former British foreign minister said Sunday he has a theory why a North Korea missile exploded seconds after launch: A US cyber-attack downed it.

“It could have failed because the system is not competent enough to make it work, but there is a very strong belief that the US — through cyber methods — has been successful on several occasions in interrupting these sorts of tests and making them fail,” Malcolm Rifkind told the BBC.

The repressive regime of Kim Jong Un tested a non-nuclear weapon Sunday but it exploded almost immediately. It came a day after North Korea, in an annual show of force, paraded missiles and rocket launchers through the streets of Pyongyang to mark the 105th birthday of Kim Il Sung, the country’s founder.

Sen. John McCain, asked during an appearance on NBC’s “Meet the Press” about sabotage thwarting the launch, cautiously dismissed the claim.

“I don’t,” the Arizona Republican said.

​Questioned whether the US has that capability, McCain said, “I don’t think so, but I wouldn’t rule it out.”

In 2014, former President Obama directed Pentagon officials to develop plans to develop possible cyber and electronic attacks against North Korea’s missile program.

Not long after, North Korean missiles begun veering off course and exploding shortly after takeoff, the New York Times reported.

President Trump would have inherited that program.

But Rifkind also warned, “don’t get too excited … they’ve also had quite a lot of successful tests.”

“They are an advanced country when it comes to their nuclear weapons program. That still remains a fact — a hard fact,” he said.

An intelligence adviser accompanying Vice President Mike Pence on his visit to South Korea, part of a 10-day tour of Asia, said the test wasn’t a surprise.

“We had good intelligence before the launch and good intelligence after the launch,” the adviser told reporters on condition of anonymity​.