BAGHDAD — The American commander of the international military campaign against the Islamic State in Iraq and Syria said Wednesday that the militants were “on the run” and facing defeat as the American-led coalition made plans to kill or capture several thousand remaining insurgents.

The Islamic State, also known as ISIS, ISIL or Daesh, is clinging to roughly 5 percent of the territory it controlled in the two countries three years ago, the commander, Lt. Gen. Paul E. Funk II, said in an interview.

“Daesh has no chance to win,” General Funk said. “The outcome is not in doubt.”

He said only about 1,500 to 2,500 militants remain in western Iraq near the Syrian border, and an additional 2,500 to 5,500 in the Euphrates River valley in eastern Syria. The coalition said that the territory controlled by the Islamic State in both countries had dropped from a peak of more than 40,000 square miles in 2014 to about 2,700 square miles today, split roughly between Iraq and Syria.

“They cannot hold territory,” General Funk said. “They cannot hold any viable cities. Their leaders have abandoned them.”