BRUSSELS — The U.S. will intensify combat against the Islamic State affiliate in Afghanistan during the Kabul government’s temporary halt to attacks on the Taliban, senior U.S. officials said Friday.

Defense Secretary Jim Mattis said this could, for example, allow the U.S. to partially shift the focus of aerial surveillance from the Taliban to ISIS fighters as well as al-Qaida extremists, who remain a threat 17 years after the U.S. invaded.

Mattis spoke to reporters during a break in a NATO defense ministers meeting, which included a discussion of progress and problems in Afghanistan. The ministers also discussed more broadly the international campaign against ISIS, which has focused since 2014 on eliminating the group’s so-called caliphate in Iraq and Syria.

In remarks to ministers at the start of the meeting, Mattis argued for continuing military pressure on ISIS even after the fighting in Syria is over. He did not mention that President Donald Trump has said he wants the U.S. to exit Syria as soon as it can, perhaps within a matter of months.

“As operations ultimately draw to a close, we want to avoid leaving a vacuum in Syria that can be exploited” by ISIS and other extremists, he said. “Our fight is not over,” he added. “We must deal ISIS an enduring, not just a territorial, defeat.”

Later he said leaving Syria before a U.N.-led peace process was underway “would be a strategic blunder.”

NATO Secretary General Jens Stoltenberg, right, speaks with the top commander of U.S. forces in Afghanistan General John Nicholson during a round table meeting of the North Atlantic Council with Resolute Support Operational Partner Nations at NATO headquarters in Brussels, Friday, June 8, 2018. (Virginia Mayo/AP)

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

Army Gen. John Nicholson, the top U.S. general in Afghanistan, said the fight against ISIS in the eastern Nangarhar province had already been intensifying this year and would be further stepped up during the Afghan cease-fire against the Taliban, which does not apply to other opposition groups. Nicholson spoke with reporters on the sidelines of the NATO meeting.

Speaking separately at a NATO news conference, Mattis said the cease-fire could put U.S. forces in a better position to fight other extremist groups such as the ISIS affiliate and remnants of al-Qaida.

“If the Taliban take full advantage of the cease-fire in the best interests of the Afghan people, then many of the surveillance assets that we have overhead can be reoriented to ISIS-K, to al-Qaida and other foreign terrorists that have no business being in Afghanistan in the first place,” Mattis said. ISIS-K is a name for the Islamic State affiliate that operates in three provinces in eastern Afghanistan.

Militants wore US military uniforms in attack in Afghanistan’s capital Islamic State militants, including two suicide bombers, dressed in military uniforms and riding in two armored vehicles launched a surprise attack on the Interior Ministry in Kabul on Wednesday but Afghan forces managed to repel the assault, leaving all the attackers dead.

Nicholson said he could not predict whether the Taliban will join the cease-fire announced this week by President Ashraf Ghani. He expressed no concern that a unilateral cease-fire would give the Taliban breathing room to regroup and rearm.

“The potential benefit is greater than the risk,” he said, expressing hope that what Ghani called a weeklong pause could lead to something more substantial and improve prospects for actual peace negotiations. The Taliban has insisted that it would negotiate only with Washington, but the U.S. insists that it talk to the Afghan government.

Afghan Defense Minister Tariq Shah Bahramee said the offer of a cease-fire “is a not a sign of weakness on the part of the government. It is a sign of our strength because we want peace.”

U.S. forces will remain prepared to respond to any Taliban attacks, Nicholson said. The U.S. has about 8,400 troops providing noncombat support for Afghan security forces fighting the Taliban; separately, roughly 7,000 U.S. combat troops are fighting al-Qaida and ISIS-affiliated groups.

Nicholson, who has commanded the U.S.-led military coalition in Afghanistan since March 2016, spoke with measured optimism about prospects for compelling the Taliban to enter peace negotiations with the Afghan government.

U.S. officials have talked up the prospects for peace many times over the course of the war, only to be disappointed. When Trump announced last August that he was committed to winning the war with a revamped strategy, he said the goal was to compel the Taliban — with help from Pakistan and other interested nations — to seek peace. However, a U.S. government watchdog agency recently reported that it saw few signs that this strategy was working, while acknowledging that the Afghan security forces are getting better training.

Nicholson, however, credited Trump’s policy with producing early signs that the Taliban might be considering peace talks, although the militant group has not publicly acknowledged it is considering negotiations with the Afghan government.

“I do think the policy is working. It just needs more time,” he said.

Nicholson acknowledged that the war is complicated by the involvement of other outside powers, including Russia, which has said it became involved out of concern that ISIS-affiliated groups there will spread to other parts of Central Asia.

“We are concerned about any external enablement (of the Taliban),” he said. “We do believe that the Russians have increased this kind of activity.” He characterized this as “small-scale support” for the insurgency.

Associated Press writer Lorne Cook contributed to this report.