President Donald Trump backed away from the precipice of war with Iran after the Islamic Republic attacked U.S. bases in Iraq with a barrage of missiles the Pentagon believes was intended to cause no casualties.

In televised remarks to the nation on Wednesday, Trump defended the U.S. strike on a top Iranian general that touched off the missile barrage and said he would impose new sanctions on Tehran.

“As long as I’m president of the United States, Iran will never be allowed to have a nuclear weapon,” Trump said as he began his speech.

But he also offered the country’s regime a diplomatic opening. Any new nuclear deal, he said, must allow “Iran to thrive and prosper, and take advantage of its enormous untapped potential. Iran can be a great country.”

Iran fired more than a dozen guided missiles at two U.S. bases in Iraq in retaliation for the killing of Qassem Soleimani. But a Pentagon analysis of the attack suggested the missiles were aimed at unpopulated parts of the bases, according to people familiar with the matter.

Satellite imagery of the bases provided by Planet Labs showed damaged aircraft hangers and other structures at the Al Asad airbase in western Iraq following the strike.

“Iran appears to be standing down,” Trump said. “Which is a good thing for all parties concerned and a very good thing for the world.”

Iran’s restraint and Trump’s measured remarks in response suggest a path toward easing tensions with Tehran, which surged after Soleimani’s killing in a U.S. drone strike near the Baghdad airport last week.

Iranian Foreign Minister Javad Zarif said on Twitter earlier Wednesday that the missile attack “concluded” Iran’s retaliation for Soleimani’s killing. Even if Tehran refrains from further direct attacks, it might still seek reprisals through more covert means, such as attacks by proxy militias or in cyberspace.

An Iranian official said earlier this week that its government was considering 13 means of retaliation that would inflict a “historic nightmare” on the U.S.

The S&P 500 pushed to a fresh intraday record after Trump’s remarks. Treasuries turned lower after spiking overnight following the Iranian attack. Oil fell below US$61 a barrel in New York.

‘Top Terrorist’

Trump said Soleimani was “the world’s top terrorist” and was “personally responsible for some of the absolutely worst atrocities,” including the training of “terrorist armies” and “fueling bloody civil wars across the region.” He said Iranian weapons Soleimani supplied to Iraqi militants had injured or killed thousands of U.S. troops.

Trump had threatened to strike 52 Iranian targets were any Americans killed in Tehran’s reprisals for Soleimani’s death.

He said Wednesday that “peace and stability cannot prevail in the Middle East as long as Iran continues to foment violence, unrest, hatred and war.” New sanctions would remain in place until the Islamic Republic becomes less bellicose, he said.

Trump said he would ask the North Atlantic Treaty Organization to become more involved in the Mideast, without elaboration.

The Pentagon said that the two bases struck by Iranian missiles -- the sprawling Al Asad and a smaller base near the city of Erbil -- had already been on high alert, and Iraq’s government said it had been forewarned of the Iranian attack. There were no Iraqi casualties from the Iranian strike.

Iranian Supreme Leader Ayatollah Ali Khamenei described the attacks on the bases as a “crushing response.”

“Last night, they got a slap in the face,” he said on state television. He again demanded that the U.S. presence in the Mideast come to an end, a sign that Tehran’s ultimate goal remains to push the American military out of Iraq.

Nuclear Accord

Trump escalated tensions with Iran in 2018 by withdrawing from the nuclear accord negotiated by his predecessor, Barack Obama, and reimposing sanctions that have crushed the Iranian economy. Iran responded by arming and directing proxy militias across the region that have caused trouble for the U.S. and its allies in Yemen, Iraq, Syria and Lebanon.

The missiles Iran fired at U.S. bases on Wednesday, Trump claimed, “were paid for by the funds made available by the last administration.” He provided no substantiation, but has frequently criticized Obama for releasing frozen Iranian assets to Tehran after the nuclear accord was completed.

Soleimani, regarded as the second most powerful person in Iran, commanded the Islamic Revolutionary Guards Corps’ Quds Force, the expeditionary arm of the Iranian military that provided support for proxy groups. Trump ordered him killed after a Dec. 27 rocket attack on a joint U.S.-Iraqi base near Kirkuk resulted in the death of an American contractor. The U.S. blamed the attack on an Iran-backed militia and killed its leader in the strike on Soleimani.

Trump has said that Soleimani was planning “imminent” attacks on U.S. forces in the Mideast, though his administration has provided little evidence for the claim.

Democrats and a few Republicans have criticized the Soleimani strike, saying it would endanger U.S. diplomatic and military personnel in the region. Administration officials will provide classified briefings to Congress later on Wednesday.

In another development, a Ukraine International Airlines Boeing 737-800 jetliner crashed Wednesday shortly after taking off from Iran, killing 176 people. Iran’s government suggested an engine fire was the cause. Other authorities didn’t follow Iran in pointing to a fire or technical issue, and the Ukrainian embassy in Tehran amended an earlier statement in which it had ruled out terrorism.

--With assistance from Mario Parker.