(CNN) The "caliphate" declared by the Islamic State in Syria and Iraq (ISIS) will lose its last two cities of any consequence -- Mosul in Iraq and Raqqa in Syria -- within months, according to the senior U.S. general in the region.

Speaking on a tour north of Baghdad this week, Lt. Gen. Stephen Townsend, commander of the Combined Joint Task Force, said the next phase of the Iraqi military operation to take Mosul will get underway imminently.

The city of some 300,000 inhabitants is ISIS' administrative headquarters, and its hub for planning overseas terror attacks. Not so long ago, ISIS controlled a wide swathe of land between Raqqa and the Turkish border, allowing as many as 2,000 foreign fighters a month to reach the "promised land."

Now most of that land is held by the group's enemies. Its leadership, weapons caches and oil revenues in Syria have been pummeled for months.

ISIS finds itself fending off enemies in all directions, over an area of several hundred square kilometers, much of it open land where the movement of any sizable reinforcements would be vulnerable to air attack. Its advantage is that -- so far -- there's been little coordination among its adversaries on the ground, and none of them seems strong enough to take Raqqa alone.

ISIS has built multi-layered defenses around the city and would be fighting among a civilian population under siege.

Three contenders

The long Syrian war has spawned a bewildering array of factions, but there are essentially three competitors in the "race" for Raqqa:

The Syrian Democratic Forces (SDF), an alliance of the main Kurdish group (the YPG) in northern Syria with several Arab groups and tribes

A combination of Turkish-backed rebel groups, supported by Turkish special forces and aerial support (and sometimes Russian air power)

The Syrian army backed by pro-government militia, Iranian paramilitaries and the Lebanese Shia militia Hezbollah (and often Russian air power)

Sometimes they compete, sometimes they quietly cooperate, and just as often they ignore each other.

The SDF are currently the closest to Raqqa -- less than 20 kilometers in some places, according to US military officials -- after advancing fairly quickly across barren, sparsely-populated plains. But they are yet to clear ISIS from the town of al-Tabqa, the site of an important dam on the Euphrates.

The SDF has received substantial support from US-led coalition aircraft -- with as many as 20 airstrikes a day around Raqqa recently, according to figures released by the coalition.

Among the targets bombed were two bridges across the Euphrates River that were essential to ISIS' mobility. Now it's much more difficult for them to move in and out of their stronghold.

Isolating Raqqa

In the words of US Central Command, "disabling the bridges will further isolate ISIL [another acronym for ISIS] fighters and they will have to take their chances with fighting and dying or surrendering to the SDF."

The SDF's next goal is to cut ISIS' communications between Raqqa and the town of Deir Ezzor to the east, which would make it much harder for the group to use the Syria-Iraq border.

JUST WATCHED US official: ISIS ranks reduced by 75% Replay More Videos ... MUST WATCH US official: ISIS ranks reduced by 75% 02:38

Coalition officials estimate the SDF can muster as many as 50,000 fighters in various states of readiness and ability. The Kurdish YPG are the most effective and numerous part of the SDF but in recent months the Arab contingent has grown to more than 20,000, of whom 13,000 have been vetted by the US military, which means they can receive training and weapons. US support for the SDF has grown to include additional Special Forces on the ground and the supply of a handful of armored vehicles.

US military officials have insisted weapons are going to Arab factions and not the YPG, in an effort to assuage Turkey -- which sees the YPG as linked to Kurdish militants inside Turkey.

By contrast, Turkish-backed factions have struggled to eradicate stubborn ISIS resistance in and around al Bab further north and remain a long way from Raqqa.

Syrian regime forces have tried to make progress towards the city, but twice have been beaten back. For a second time, ISIS captured the town of Palmyra, with its precious architectural heritage, in December. The Syrian army and supporting militia have been focused on taking and holding Aleppo and securing the main routes linking government-held territory. Raqqa is a mission too far at present, some 150 kilometers from the closest regime front line.

Humanitarian disaster in waiting?

JUST WATCHED Turkey to US: 'Let's take Raqqa back together' Replay More Videos ... MUST WATCH Turkey to US: 'Let's take Raqqa back together' 01:14

Barring the complete (and unlikely) collapse of ISIS resistance, the final assault on Raqqa will be a street-by-street slog. It would be well beyond the capability of the Arab component of the SDF alone.

It's taken the Iraqi Army, with massive coalition air support, three months to take half of Mosul, whose civilians have been able to escape to established camps outside the city thanks to the deep presence of UN agencies. There is no such option around Raqqa, which could quickly become a humanitarian disaster.

"It would probably take a major ground intervention by one of the main external players -- the US, Turkey, or Russian and Iranian-backed Syrian government forces -- to expel the Islamic State from Raqqa," says IHS Janes analyst Columb Strack.

Trump's role

The big question is which of these external players will step up and whether they will work together. US President Donald Trump has spoken several times of cooperating with Russia against ISIS in Syria, and in his phone call with President Vladimir Putin on January 28, the Kremlin said the two leaders agreed to "establish real coordination" against "terrorist groups" operating in Syria.

The Trump administration is also moving to improve relations with Turkey, which were severely strained in the last few months of the Obama administration over its support for the Syrian Kurds, among other issues.

JUST WATCHED Plan to seize ISIS 'capital' Raqqa announced Replay More Videos ... MUST WATCH Plan to seize ISIS 'capital' Raqqa announced 02:07

Trump and President Recep Tayyip Erdogan have spoken recently, and the semi-official Turkish news agency Anadolu reported that cooperation in evicting ISIS from al Bab and Raqqa was discussed. The White House readout was less specific.

US defense officials have prepared a variety of options, including adding hundreds or even thousands of US ground forces to support (though not take part in) an attack on Raqqa. Another option would be to arm Kurdish fighters, though that would obviously anger Turkey. Erdogan reminded Trump of Turkey's view of the YPG in their call, Anadolu reported.

Some within the US military believe the injection of US ground forces is a risk too far.

In his last interview as defense secretary, Ashton Carter told the Associated Press that more US troops would mean " fighting on the enemy's terms , which is infantry fighting in towns in a foreign country."

As the battle space becomes more crowded and fluid, there is also the risk of mistakes. Russian planes killed three Turkish soldiers near al Bab this week. And Colonel John Dorrian, the coalition spokesman, noted the area was "becoming more complicated as the forces converge around al Bab, so we'll maintain our de-confliction channel with the Russians."

The campaign for Raqqa will help shape the new US administration's attitude towards military interventions overseas, its appetite for collaboration with Russia and its perspective on the future of Syria. There's a lot at stake.