The top U.S. military commander in Afghanistan said security across the country is deteriorating just weeks before the last American forces withdraw.

Gen. Scott Miller, in a rare briefing on Tuesday, said that recent gains by the Taliban are highly concerning, even if not unexpected.

"The security situation is not good right now," he told a small group of reporters at the fast-emptying coalition headquarters in Kabul. "Civil war is certainly a path that can be visualized if this continues on the trajectory it’s on right now. That should be a concern to the world."

In recent weeks, nearly a quarter of Afghanistan’s districts have fallen to the Taliban as the Islamist movement gained momentum following President Biden’s April announcement that all U.S. troops would be gone by Sept. 11.

Gen. Miller declined to say when exactly the departure of American forces would be completed, citing operational security reasons. The U.S. military already has drawn out more than half of its equipment and personnel and is expected to complete the pullout by mid-July, officials have said.

The Afghan National Security Forces, funded by billions of dollars in American assistance over the years, have failed so far to stop Taliban advances. In many cases, the Afghan troops surrendered without a fight, leaving U.S.-provided Humvees and weapons to the Taliban.

MILITIAS FIRE ROCKETS AT US FORCES IN SYRIA FOLLOWING AIRSTRIKES

A recent U.S. intelligence assessment, first reported by The Wall Street Journal, concluded that the government of Afghanistan could fall within six months of the U.S. military departure.

Gen. Miller, who has commanded all American forces in Afghanistan since September 2018 and previously headed U.S. special operations in the country, reiterated that only a political solution will end the war in Afghanistan. Yet, he warned: "If you don’t reduce the violence, that political solution becomes more and more difficult."

Afghan and U.S. officials said that Afghan security forces had been successful in retaking some districts in recent days. Mohammad Afzal Hadid, the Balkh provincial council chief, said part of Kaldar district, which shares a border with Tajikistan and Uzbekistan, was retaken by Afghan security forces on Tuesday. The offensive was conducted by regular Afghan forces jointly with militias loyal to the powerful former governor of Balkh, Atta Mohammad Noor, he said.

According to Mr. Hadid, the police and district governor headquarters in Kaldar are now controlled by Afghan forces. "Fighting is under way right now to clear the district," he said.

Kaldar fell to the Taliban three days ago, and Afghan forces deployed there fled across the Amu Darya river to Tajikistan and Uzbekistan.

Maj. Gen. Khanullah Shuja, the new commander of the 209th Shaheen Corps in the northern city of Mazar-e-Sharif, said his command expects to begin taking back other strategically valuable districts from the Taliban in coming days.

U.S. military advisers over the years have urged the Afghan government to focus its efforts on fighting the Taliban in important districts, around cities and major highways, leaving less strategically valuable districts in more rural areas to the Taliban. That recommendation is even more important now that the Afghan government’s resources are shrinking. The country’s new defense minister, Gen. Bismillah Khan, has begun to execute that strategy, Gen. Miller said.

Mr. Biden has been unequivocal that only a unit assigned to protect the U.S. Embassy in Kabul will remain in Afghanistan. A new commander, more junior in rank than a four-star general, is expected to head that unit, Gen. Miller said.

Ultimately, that unit may count several hundred military personnel, providing security for the embassy and its staff as well as maintaining a very limited advisory capacity, officials have said. But the U.S. military mission will be essentially over, and the bulk of American support for the Afghan government and security forces will be through billions of dollars of assistance. Afghan forces may receive that assistance outside the country, including via remote training, officials said.

CLICK HERE TO GET THE FOX NEWS APP

Security of the Kabul international airport remains indispensable for a continuing American presence at the embassy. The Turkish government has agreed in principle to maintain hundreds of troops at the airport and run its flight operations in return for U.S. financial support and other conditions. This deal, however, isn’t yet completed and may fall through, which would force most major airlines to stop flying to the Afghan capital.

Gen. Miller, who is the longest-serving U.S. commander since the American invasion of Afghanistan in 2001, was asked on Tuesday what the legacy of the U.S. role in the conflict in Afghanistan will be and whether the U.S. policy here had been a failure.

"The legacy will be written by the future," Gen. Miller replied. "As we move forward, the future will tell the rest of the story."

To read more from The Wall Street Journal, click here.