The chairman of the Joint Chiefs of Staff, Gen. Joseph Dunford, speaks at the Pentagon with Defense Secretary Jim Mattis on Aug. 28, 2018. (Zach Gibson/Getty Images)

The United States will maintain a permanent diplomatic presence in Afghanistan, but the Pentagon does not expect an endless large-scale military mission there, the most senior U.S. military officer said Tuesday.

Marine Gen. Joseph F. Dunford Jr., chairman of the Joint Chiefs of Staff, pushed back at the notion that the United States was locked in a never-ending war in Afghanistan, which Washington and allies invaded in 2001 in what was expected to be a brief campaign against extremists.

Today, the Trump administration is conducting a re-energized campaign aimed at helping Afghan troops combat a large and powerful Taliban force. This weekend, the ninth American commander of international forces in Afghanistan, Army Lt. Gen. Austin “Scott” Miller, is set to take command, marking another inflection point in what has become the ­United States’ longest war.

“We have permanent interests in South Asia, diplomatic interests and security interests. And we’re going to maintain a presence to have influence in that region,” Dunford said. “The form of that presence is going to change over time. . . . But I certainly don’t expect that the current forces that we have in Afghanistan represents an enduring large military commitment.”

There are about 15,000 U.S. troops in Afghanistan, down from a peak of about 100,000 under President Barack Obama’s surge. While officials expect that the U.S. force could shrink in the future with a hoped-for improvement in security, the United States has maintained large military footprints in some other nations, including Japan, Germany and South Korea, for decades.

Dunford and Defense Secretary Jim Mattis, in a rare appearance in the Pentagon briefing room, highlighted the efforts of Afghan security forces and said their opponent, the Taliban, was showing signs of increased interest in negotiating a settlement to end the war.

Mattis pushed back against suggestions that a recent Taliban offensive in the Afghan city of Ghazni had demonstrated the weakness of local forces. Afghan troops required assistance from U.S. forces to fight a ferocious Taliban onslaught in Ghazni.

“This is not an easy fight. We’ve never said it was,” Mattis said. “But I don’t believe that you can use this example as emblematic, because if you look at where the Taliban were and what they were claiming they were going to do two years ago, one year ago, they have not succeeded in taking down these towns and holding these towns.”

Mattis said Afghan forces had taken “serious casualties” over the past year and had remained in the fight, a sign of their determination. He suggested that support was growing among Taliban fighters for cease-fires like the one that was imposed temporarily in June.

The Taliban more recently rejected an offer from President Ashraf Ghani to begin another mutual cease-fire.

“There’s a lot more to this than purely traditional military who-shot-who today,” Mattis said. “We think there are positive reasons to stick with the strategy. And we are going to drive this to a negotiated settlement.”

The Trump administration is hoping that increased military pressure will help prompt peace talks, but the Taliban has refused to negotiate with the Afghan government.

Mattis also dismissed a proposal from Blackwater founder Erik Prince to replace U.S. military personnel with private contractors in Afghanistan.