“We need to try one more time to make this strategy work with them, by, with and through the Pakistanis, and if our best efforts fail, President Trump is prepared to take whatever steps are necessary," Mattis said at a House Armed Services Committee hearing.

Mattis was testifying in front of the committee alongside Joint Chiefs of Staff Chairman Gen. Joseph Dunford, the pair’s second hearing of the day on the U.S. strategy in Afghanistan.

The U.S. relationship with Pakistan has ebbed and flowed over the course of the 16-year war in Afghanistan, getting most tense after U.S. special forces killed al Qaeda leader Osama bin Laden in Pakistan in 2011.

In his August speech outlining his new strategy for Afghanistan, President Trump said the United States would do more to pressure Pakistan to combat terrorist safe havens in its borders.

But he did not provide any details on how.

Pakistan denies that it provides safe haven to terrorists, often pointing to the operation launched in 2014 to clear groups such as the Haqqanis from the Waziristan border region with Afghanistan.

But at the Tuesday morning Senate Armed Services Committee hearing, Dunford said he believes Pakistan’s main spy agency has ties to terrorist groups.

“It is clear to me that the [Inter-Services Intelligence] has connections with terrorist groups,” Dunford said.

Reported options for pressuring Pakistan to do more include curtailing or conditioning aid, sanctioning Pakistani officials, stepping up drone strikes inside the country, taking away its status as a major non-NATO ally or naming it as a state sponsor of terrorism.

Asked Tuesday at the House hearing whether taking away Pakistan’s status as a major non-NATO ally is an option on the table, Mattis said he’s “sure it will be.”

Mattis said he’d “like to think we will be successful,” but that the United States has an “enormously powerful number of options” if not.

“I think that right now with the growing consensus against terrorism, they’ll find themselves diplomatically isolated, they’ll find themselves economically in increasing trouble as countries that are damaged by this terrorism coming out of there say enough is enough and take steps,” he said. “There’s an awful lot of advantage to Pakistan coming on line with the international community.”