Mattis's expression of support for the 2015 agreement curbing Iran's nuclear program was in sharp contrast with Trump's blunt assessment that the deal is an "embarrassment."
Asked during a Senate hearing whether he believed it was in the national interest, Mattis replied: "Yes, senator, I do."
"If we can confirm that Iran is living by the agreement, if we can determine that this is in our best interest, then surely we should stay with it."
"I believe at this point in time, absent indication to the contrary, it is something that the president should consider staying with," he said.
Trump must notify Congress every 90 days whether Iran is abiding by the accord and whether the lifting of sanctions against Tehran is in the US national interest.
He has so far certified that Iran is in compliance with the agreement but has indicated the next deadline on October 15 will be crucial.
Iran and the other signatories -- China, Russia, France, Britain and Germany -- defend the deal as a guarantee of the peaceful, non-military purposes of Tehran's nuclear program.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)