President Donald Trump’s top military adviser just openly contradicted Trump’s position on the Iran nuclear deal while testifying in front of Congress, adding to the growing number of prominent officials who have publicly disagreed with the president’s belief that the Iran deal is bad for the US and should be canceled or renegotiated.

During a Senate Armed Services Committee hearing on Tuesday, Secretary of Defense James Mattis was asked if he thinks it’s in America’s national security interest to remain in the Iran deal. After a noticeable pause, Mattis finally replied: “Yes, senator, I do.”

Trump has been hinting for months that he’s ready to take steps to withdraw from the Iran nuclear deal as a crucial October deadline approaches that could decide the fate of the agreement. In a statement in August he said Iran is “not in compliance with the agreement and they certainly are not in the spirit of the agreement in compliance,” and in September he called the agreement an “embarrassment” during a speech to the United Nations.

But this position is at odds with the majority of Trump’s foreign policy and national security officials. Earlier in the same congressional hearing, Marine Gen. James Dunford, chair of the Joint Chiefs of Staff, said Iran "is not in material breach of" the deal and affirmed that its implementation has "delayed the development of a nuclear capability by Iran."

Dunford’s comments are in line with the position of another high-ranking officer, Air Force Gen. John Hyten. Speaking at the conservative Hudson Institute in September, Hyten said “the facts are that Iran is operating under the agreements that we signed up for under the [Iran nuclear deal].”

The International Atomic Energy Agency, the UN-backed agency in charge of monitoring the deal, has also consistently reported that Tehran is complying with the terms of the agreement.

Under US law, Trump has until October 15 to certify that Iran is complying with the nuclear deal. If he declines to certify Iran, then Congress will have the option to reimpose sanctions on Iran, which would effectively end the deal.

But right now a number of GOP senators including Sen. Jeff Flake (AZ), Sen. Susan Collins (ME), and Sen. John McCain (AZ) are undecided on whether they’d vote to reimpose sanctions on Iran. In other words, even if Trump decides to officially label Iran as noncompliant, his own party might refuse to take further steps to torpedo the agreement.

Having heavyweights like Mattis weighing in to support the deal could give Republican senators more reason to stand in disagreement with president.