President Trump has full legal authority under a 2001 war authorization to send U.S. ground troops after the Boko Haram extremists in Africa if he decided it was necessary, Defense Secretary Jim Mattis said in testimony to a Senate committee Monday.

Mattis was responding to a hypothetical question by Sen. Ben Cardin, D-Md., the ranking member of the Senate Foreign Relations Committee, on how far the president’s powers go under an aging authorization for the use of military force, or AUMF, passed after the 9/11 attacks.

The 2001 AUMF gave the Bush administration legal authority to fight al Qaeda, the Taliban, and associated groups, but the Senate committee is again grappling with replacing or updating the legislation. That effort has been underscored in recent weeks by an ambush of U.S. troops in Niger that killed four soldiers.

“From what I understand, you’re saying, unless we modify this AUMF, you would feel that you have adequate authorization to commit American ground troops in northern Africa,” Cardin said.

Mattis said troops in Africa are currently deployed for noncombat advisory roles, but combat against Boko Haram, which operates primarily in Nigeria, could fall under the president’s existing authority.

“If the president determined they are a threat to the United States and under the AUMF if they say they are allied with al Qaeda or ISIS, yes, sir, I believe so,” Mattis said.

Cardin has argued Trump does not have a legal basis under the existing AUMF to fight ISIS and he pushed back against Mattis’ assertion.

“When we were attacked on Sept. 11, we recognized the need for a military response and we certainly understood that American troops are going to be called upon to protect our country. I’m not sure that Congress envisioned that we would have the potential of ground troops in northern Africa in combat missions,” he said.