It was supposed to be a public relations bonanza. A pair of new F-35 fighter jets were scheduled to streak across the sunny desert sky here on Monday afternoon and land to rapturous applause by Israeli and American leaders and military brass.

But first, fog socked in an Italian air force base outside Milan, delaying for hours the takeoff of the F-35s on the last leg of their journey from Texas to Israel.

Tired of the long wait, many of the guests departed, a reverse parade of military attaches heading back to their embassies, followed by television news crews who didn’t think footage of airplanes landing in the dark would be terribly gripping.

Then, out of nowhere, ­President-elect Donald Trump decided to strafe the F-35 in a tweet.

“The F-35 program and cost is out of control,” Trump wrote Monday. “Billions of dollars can and will be saved on military (and other) purchases after January 20th,” the date of his inauguration.

Trump didn’t mention any defense companies by name, but share prices of the lead F-35 contractor, Lockheed Martin, closed 2.47 percent lower Monday.

Finally, the two F-35s landed here at 8:16 p.m. It was dark.

The two aircraft were flown by U.S. pilots, and they were greeted by Israeli Prime Minister Benjamin Netanyahu and U.S. Secretary of Defense Ashton B. Carter.

Carter said there was no better symbol of the relationship between the United States and Israel than the F-35.

“Together, we will dominate the skies,” he said. “With the turmoil in the region, we’re more dedicated to Israel’s security today than ever before.”

Netanyahu said, “Our goal is to obtain supremacy in every theater: in the air, in the sea, on the ground and cyber.”

The arrival of the first F-35s should serve as a warning to Israel’s opponents, the prime minister said.

“I want to be clear: Anyone who thinks of attacking us will be attacked. History has taught us that only strength brings deterrence, only strength brings peace and respect,” Netanyahu said, according to a translation by the Jerusalem Post.

The two stealthy fighter jets cost Israel around $110 million each. Israel announced that it would acquire 50 of the aircraft, which are designed to evade detection by sophisticated surface-to-air missiles and top-flight fighter planes.

In September, after months of negotiation, the Obama administration signed an unprecedented pact with Israel that will provide the Jewish state with the largest amount of military aid ever awarded, $38 billion over 10 years, with promises of the latest in missile defense systems, ­cutting-edge technology and fighter jets such as the F-35.

Israel is the first country outside the United States to receive the F-35s. The Israeli Air Force hopes to have them mission-ready within a year.

The deputy commander of Nevatim air base called the F-35 more than a flying machine.

“It’s a war system,” said Col. Asaf, who because of security protocols agreed to be identified only by his first name and rank.

The colonel described the airplane as a lethal combination of technology and stealth. It will be mostly invisible to enemy aircraft and ground-based antiaircraft batteries.

Israeli Air Force officers say the fifth-generation F-35s will allow the penetration of enemy airspace without detection.

“It’s a completely different ballgame,” said another Israeli Air Force commander, who briefed reporters on the condition of anonymity.

The officer said the F-35 is not faster or more agile than the F-16s and F-15s the Israelis currently fly. Nor can it carry more weapons.

“The difference is they can’t see you,” he said. “And by the time they do see you, they are in trouble.”

Russia recently delivered advanced antiaircraft batteries to Iran. “As far as we know, nobody has flown the F-35 against the S-300s,” the Russian-made ­surface-to-air missiles. “But we don’t see this as a big challenge for the F-35,” the commander said.

Jack Crisler, a Lockheed Martin vice president for business development, was on hand at Nevatim for the landing ceremony.

He said the F-35 was designed specifically to best the latest antiaircraft missiles. In addition to its ability to jam enemy radar and penetrate undetected into an adversary’s airspace, Crisler said the airplane collects and processes reams of data about the battlefield. The pilot is offered a 360-
degree view, which is shown on an Israeli-designed helmet visor.

Crisler said the cost of the F-35 in 2019 will be $85 million, making it highly competitive.

He chafed at the suggestion that the plane can’t fly in the fog.

Crisler said that it was Italian authorities who put a halt to takeoffs during the afternoon’s bout of bad weather.

The Israeli deputy commander said four Israeli pilots have been training on simulators in the United States and on Tuesday will take the two F-35s for their first flights here.

Israeli officials say the F-35 will be used for all its air force missions, including in possible future confrontations with Iran and the militant groups Hezbollah and Hamas.

This means that if Hamas and Israel fight a fourth war in Gaza, the world’s most advanced fighter jet will go against an enemy that makes homemade rockets out of repurposed sewer pipes.