White House National Security Adviser Amb. Robert O'Brien said Tuesday that the Iranians underestimated President Trump's "level of restraint" before theU.S. airstrike in Baghdad that killed Iranian Gen. Qassem Soleimani last week.

Appearing on "Fox & Friends" with hosts Steve Doocy, Ainsley Earhardt, and Pete Hegseth, O'Brien said that intelligence had shown Soleimani was plotting an attack to kill American diplomats and soldiers in "significant numbers in the coming days."

He also told the "Friends" hosts that Soleimani was heavily involved from the early days in the Iranian nuclear program.

"He was sanctioned by the United Nations. In fact, he was not supposed to be traveling outside of Iran under U.N. sanctions because of his role in the nuclear program," said O'Brien. "So, we think it will have an effect."

Coffins of Gen. Qassem Soleimani and others who were killed in Iraq by a U.S. drone strike, are carried on a truck surrounded by mourners during a funeral procession, in the city of Kerman, Iran, on Tuesday.

Coffins of Gen. Qassem Soleimani and others who were killed in Iraq by a U.S. drone strike, are carried on a truck surrounded by mourners during a funeral procession, in the city of Kerman, Iran, on Tuesday. (AP/Tasnim News Agency)

Soleimani was the head of the Iran Revolutionary Guards’ elite Quds Force. The U.S. had blamed him for the killing of American troops in Iraq and accused him of plotting new attacks just before his death. Soleimani also led forces in Syria backing President Bashar Assad in a long war and served as the point man for Iranian proxies in countries like Iraq, Lebanon, and Yemen.

Killing Soleimani, O'Brien argued, was necessary to prevent Iranian aggression.

SOLEIMANI FUNERAL STAMPEDE IN IRAN LEAVE AS LEAST 40 DEAD, STATE TV REPORTS

"We also believe [in] peace-through-strength. And, it was a deterrent to future Iranian action that has been prescribed by the U.N. and by the international community," he added.

O'Brien said that there is "absolutely zero appetite in the international community for Iran to have a nuclear weapon" and that the message the officials wanted to send Iran is that they're "not going to tolerate" any more actions taken against the U.S.

A U.N. Security Council meeting is scheduled for Thursday. Iranian foreign minister Javad Zarif -- who called the attack that killed Soleimani "state terrorism" -- reportedly wanted to attend but was denied access.

The move is a violation of the terms of a 1947 headquarters agreement requiring Washington to permit foreign officials into the country to conduct UN business.

O'Brien said he believes it was "ironic" that Zarif wanted to "take advantage of the diplomatic niceties of being able to come to New York" when "his revolution was born in the taking of 52 American diplomats hostage in Iran and holding them for 444 days."

"They undermined every principle of democracy," said O'Brien. "So, I think he will be fine missing that meeting."

CLICK HERE FOR THE FOX NEWS APP

"The president believes that weakness is provocative, and I think we have seen that throughout history," he continued. "It's something that's been a cornerstone of President Trump's foreign policy and national security policy."

"Soleimani and the Iranian regime knew exactly what they were doing," the ambassador said. "And what I think they did is they underestimated the president and his restraint."

Fox News' Greg Norman, the Associated Press, and Danielle Wallace contributed to this report.