Secretary of Defense James Mattis said Tuesday at a Senate hearing that he believes the U.S. should not end the nuclear deal with Iran.

When asked by Sen. Angus King, I-Maine, if he believes that it is in the national security interest of the U.S. to stay in the deal, Mattis replied: "Yes, Senator, I do."

Mattis, a former Marine general, has indicated his reluctance to leave the nuclear deal before. "When America gives [its] word, we have to live up to it and work with our allies," he told a Senate panel during his confirmation hearings in January.

President Trump campaigned on ending the nuclear deal with Iran, which he insisted was negotiated poorly by the Obama administration. Mr. Trump called the deal, which was designed to curb Iran's nuclear weapons program, "an embarrassment to the United States" during a speech to the UN in September.

Get Breaking News Delivered to Your Inbox

Since taking office in January, Mr. Trump has twice certified that Iran is complying with the deal. However, he has indicated that he is unlikely to do so again before the October 15th deadline to review the accord.

Mattis also told the Senate panel that Afghan security forces are fully engaged in offensive military operations for the first time during the 16-year-old war, and that Afghan forces are suffering fewer casualties as they continue to improve.

Mattis says more than 3,000 additional U.S. troops are being sent to Afghanistan to reinforce the roughly 8,400 American forces currently stationed there.

President Trump announced in August a plan to end America's longest war and eliminate a rising extremist threat in Afghanistan.

Sen. John McCain of Arizona, the chairman of the Armed Services Committee, lectured Mattis and Gen. Joseph Dunford at the opening of the hearing. McCain says the Trump administration has failed to inform Congress of the details of the strategy spelled out by Trump.