The global fight against ISIS has been halting and complex since it began in late 2014.

The United States has led an international coalition of more than 60 countries against ISIS. Some nations — including the United Kingdom, Australia, France and a handful of regional powers — have helped launch airstrikes in Iraq and Syria, while others have cracked down on the flow of funds and foreign fighters to ISIS. Still others have contributed humanitarian aid, taken in refugees or provided weapons and training to fighters on the ground.

But while the U.S. has maintained a narrow focus on degrading and ultimately defeating ISIS, competing agendas among a group of eight key players involved in the fight have served to complicate that effort. Here’s how.

Iraq

For Iraq, defeating ISIS is a matter of national security and survival, as the terrorist group seized large swaths of the country’s territory over the course of 2014, including the nation’s second largest city — Mosul. The government joined the international coalition against ISIS, and invited the U.S. and other coalition partners to conduct airstrikes against the group inside Iraq.

However, the Iraqi government was hobbled in the fight against ISIS by the near total collapse of the Iraqi army in 2014. In battles to retake cities like Amerli, Tikrit and Fallujah, the Shia-dominated government of Prime Minister Haider al-Abadi has been reliant on the al-Hashd al-Shaabi, or Popular Mobilization Forces, an umbrella group comprised of Shia militias that have been accused of carrying out attacks against Sunni civilians. The fear among U.S. officials is that such sectarian excesses could further contribute to disenfranchisement and resentment among Sunnis — some of the same factors that allowed ISIS to recruit from among Iraq’s disillusioned Sunni population in the first place.

Abadi has tried to bring the Popular Mobilization Forces into the official fold of the state. He told FRONTLINE the militias are now working with the government — not against it, as in the past. When asked about allegations of atrocities carried out by some of the militias, Abadi said, “We have to find the culprits and make them accountable. My government has zero tolerance towards any excesses in the war.”

While Iraq has had military victories against ISIS, retaking Tikrit, Ramadi, Fallujah and other cities from ISIS, analysts say finding a political solution to balancing the country’s disparate groups and addressing sectarian divides is vital. “Without the political victory to supplement the military victory, we could be talking about these wars in a few years time again,” says Renad Mansour, a fellow at Chatham House, an independent policy institute in London.

Shia Militias

The Popular Mobilization Forces have played an instrumental role in Iraq’s battle against ISIS. However, the presence of long-established Shia militias inside the PMF — some of which are backed by Iran, some of which fought an insurgency against American troops during the Iraq war, and some of which have been accused of sectarian abuses against Sunni civilians — makes their involvement in the fight highly problematic for the United States.

“We do not enable Shia-backed militia at all,” U.S. Defense Secretary Ash Carter told FRONTLINE. “The hell of Iraq has been sectarian violence.” Iraqi security forces, Carter added, had “borne the brunt of the fighting and had the lion’s share of victories” against ISIS.

Nonetheless, Shia militias have supported Iraq’s military, which is still recovering from near collapse in 2014. Despite mutual acrimony, American warplanes have bombed ISIS positions before Iraqi security forces, many times bolstered on the outskirts of the fight by Shia militias, advance on the ground. In the aftermath, Sunni residents have accused the Shia militias of detaining, beating and sometimes summarily executing Sunnis.

In addition to their sectarian nature, the Shia militias also pose a threat to the stability of Iraq’s government. Some of the militias, like the Badr Organization, have political aspirations in Iraq, while others are closely aligned with Iran’s interests in the country. “You can’t exactly be only a militia unless there’s a war going on,” says Ramzy Mardini, a fellow at the Rafik Hariri Center at the Atlantic Council. “After ISIS, I think many of these groups are going to turn to politics as a way of maintaining their organizational survivability.”

Turkey

Turkey’s government has called for the removal of Syrian President Bashar al-Assad since late 2011, and provided military and financial assistance to Syrian rebel groups fighting the regime. During the early days of ISIS’s emergence in Syria, analysts say Turkey viewed the terrorist group as a manageable threat, one that would further destabilize the Assad regime without threatening Turkey’s national security.

As ISIS established a presence in Turkey, funneling thousands of foreign fighters through the Turkish-Syrian border and carrying out deadly attacks on Turkish soil, Turkey joined the fight against ISIS in earnest in July 2015. The country tightened control over its border with Syria, arrested hundreds within Turkey suspected of having ties to ISIS, blocked or deported foreigners suspected of trying to join ISIS from Turkey, and opened its airbase at Incirlik to the anti-ISIS coalition.

For Turkey, the anti-ISIS fight has been complicated by the U.S. decision to partner with the Popular Protection Unit, a Kurdish militia in Syria known more commonly as the Y.P.G. While the Y.P.G.’s fighters have proven to be effective at retaking territory from ISIS, Turkey considers the group a terrorist organization because of its close ties to the Kurdistan Workers’ Party — otherwise known as the P.K.K. — a Turkish Kurd militant organization that has fought the Turkish government since the mid-1980s. Indeed, when Turkey launched airstrikes against ISIS in 2015, it also hit P.K.K. targets in Iraq.

“It’s difficult for us to understand why our ally, the United States — a NATO ally with which we have a model partnership, will support an organization that directly or indirectly attacks Turkey,” Ibrahim Kalin, chief foreign policy advisor to Turkish President Recep Tayyip Erdogan, told FRONTLINE. Unlike the U.S., which has taken an ISIS-first approach to the conflict in Syria, Turkey — which hosts 2.7 million Syrian refugees — sees the removal of Assad as a more important priority.

“There are two monsters of the Syrian war,” Kalin said. “One is the Assad regime, the other one is ISIS. And they feed off each other.”

The Kurds

Kurdish forces have been the United States’ favored ally on the ground in the fight against ISIS. Whether it’s Kurdish peshmerga forces in Iraq, or the Y.P.G. in Syria, Kurdish fighters have enjoyed the backing of U.S. airstrikes, and military assistance and training from other coalition partners. Y.P.G. fighters gave the anti-ISIS coalition its first, highly visible victory in the Syrian town of Kobani in January 2015, and retook Manbij from ISIS in August in conjunction with Syrian Arab fighters. Under the umbrella of the U.S.-backed Syrian Democratic Forces, they have been preparing for an offensive on ISIS’s self-declared capital in Raqqa, while in Iraq, the peshmerga led offensives to retake Sinjar, and Mosul Dam from ISIS.

Kurds, an ethnic group that was dispersed among Iraq, Iran, Syria and Turkey by the collapse of the Ottoman empire, have been able to gain a measure of autonomy amidst the chaos in Iraq and Syria. For the Kurds, analysts say, the fight against ISIS is not just about survival, but about ensuring a political stake in the future of their respective countries. “The Kurds not only have gained a great deal from the war, but they have no intention of going backwards,” says Ramzy Mardini, a fellow at the Rafik Hariri Center at the Atlantic Council.

Syrian Kurds have consolidated territory into a semiautonomous region called Rojava, while the Kurdistan Regional Government in Iraq has been able to increase its territory in the north of the country.

However, the United States’ backing of the Y.P.G. in Syria, which has ties to the P.K.K. in Turkey, has strained the relationship with Turkey, an important U.S. ally in the fight against ISIS. In a stark illustration of conflicting interests, Turkey and the rebel groups it backs have targeted some of the same Kurdish forces the U.S. has relied on to fight ISIS.

Saudi Arabia

The Kingdom of Saudi Arabia has been involved in the Syrian conflict for years, providing military and financial aid to rebel groups fighting against Syrian President Bashar al-Assad since at least 2013. When the power vacuums created by the conflict allowed the Sunni terrorist group ISIS to grow in strength and size, Saudi Arabia — a Sunni-majority country — joined the U.S.-led coalition in airstrikes against it.

The rise of ISIS poses a specific threat to Saudi Arabia, experts say, because it challenges the religious credibility of the Saudi kingdom. “ISIS presents itself as the ‘authentic Islamic caliphate,’ and that of course presents Saudi Arabia with a religious challenge, because the Saudi state is the custodian of the holy sites of Islam,” said Lina Khatib, the head of the Middle East and North Africa Program at Chatham House. “The problem that Saudi Arabia has with ISIS is beyond terrorism and instability. It’s also about the ideological challenge and competition that the Islamic State project poses.”

Despite such challenges, the terrorist group may not even rank as Saudi Arabia’s highest priority in Syria. As Prince Turki al-Faisal, Saudi Arabia’s intelligence minister from 1977 to 2001, told FRONTLINE, officials in the kingdom believe it is important to first fix the conditions that led to the rise of ISIS in the first place. “We all talk about fighting terrorism,” he said. “Who is the biggest terrorist in Syria? Who has killed more than 300,000 Syrians? Who has dislocated millions of Syrians? … It is Assad. For us to defeat ISIS, Assad has to go.”

Further complicating U.S. efforts against ISIS has been Saudi Arabia’s decision last year to shift its focus to another nearby conflict: the war in Yemen.

The Saudis view what started as a Shia rebellion in Yemen as a coup orchestrated by its archrival, Iran, against the government of its southern neighbor. Saudi Arabia has become increasingly wary of what it sees as Iranian encroachment in the region, particularly with Tehran exerting military influence in Syria and Iraq. When Saudi Arabia shifted focus to Yemen, most of the military assets it had committed in the fight against ISIS went with it.

“Their analysis, I believe, is that the Iranian threat is an immediate and existential one that has to be dealt with at once or all will be lost,” Hussein Ibish, senior resident scholar at the Arab Gulf States Institute, told FRONTLINE, whereas ISIS is viewed as “much less threatening and much less urgent.”

The Gulf States

Along with Saudi Arabia, smaller Gulf nations like the United Arab Emirates, Bahrain, Kuwait, Qatar and Oman joined the international coalition to combat ISIS in 2014.

Three of these nations — the UAE, Bahrain and Qatar — sent aircraft to accompany the first U.S.-led airstrikes against ISIS. The UAE suspended its efforts after Jordanian pilot Mouath al Kasasbeh was captured by ISIS, voicing concerns about the coalition’s search and rescue capabilities. It renewed its participation in February 2015 after news of Kasasbeh’s execution by assisting Jordan with strikes.

Bahrain continues to provide a strategic base in the Persian Gulf for the U.S. Navy’s Fifth Fleet, and Kuwait hosts an American military base.

But the Obama administration would like to see Gulf States doing more. In April, it urged them to go beyond just logistical support, and to offer financial and political support to Iraq and the Syrian opposition. While there is a strong anti-ISIS sentiment in the region, the Gulf nations see Iran’s growing influence in the region — through the conflict in Yemen and its support for the Assad regime in Syria and Shia militias in Iraq — as an equally large threat.

“The biggest reason why we haven’t seen impeccable or really effective support from the Gulf states is that they are looking elsewhere,” said Bilal Y. Saab, the director of the Middle East Peace and Security Initiative at the Atlantic Council, adding that “the number one threat has always been Iran.”

Jordan

Jordan, the home of the late ISIS founder Abu Musab al-Zarqawi, has been a consistent Arab ally in the fight against ISIS. The Jordanian Air Force participated in the first rounds of coalition airstrikes against ISIS targets in September 2014, a campaign that accelerated in February when ISIS released video of Kasasbeh’s execution. The horrific footage sent shockwaves throughout Jordan. King Abdullah II vowed to wage a “relentless war against ISIS” and “hit them in their own ground.” Jordan launched a three-day intensive air campaign and extended its operation into Iraq.

But commentators have questioned how Jordan will be able to sustain its participation in an air campaign given the strength of its air force, and its heavy dependence on economic and military aid from the U.S. This year, the United States government approved $1.6 billion in aid to Jordan. The Obama administration has pledged to send $1 billion a year until 2017, pending Congressional approval.

The Jordanian intelligence service, in return, shares information with the CIA. Jordan also hosts U.S. special forces and has provided support to rebel groups on Syria’s southern front.

Although Jordan has not seen a large-scale ISIS attacks, the group has made the overthrow of Jordan’s monarchy a stated goal, and isolated incidents have targeted the nation’s security forces. The country is also contending with an influx of refugees fleeing violence in neighboring Syria. The United Nations has registered more than 650,000 refugees in Jordan, which amounts to 10 percent of the population.

Russia

In September 2015, Russian President Vladimir Putin seemed to indicate a willingness to join the fight against ISIS. Speaking before the U.N. General Assembly, Putin called for a “genuinely broad international coalition,” saying it was an “enormous mistake to refuse to cooperate with the Syrian government and its armed forces who are valiantly fighting terrorism face to face.”

Just days later, Russian aircraft carried out their first strikes in Syria, targeting mostly Syrian rebels, not ISIS. Since Russia’s entry into the Syrian conflict, it has been a staunch supporter of Assad, providing air power to the Syrian army and Shia militias fighting against Syrian rebels. Putin, analysts say, has taken the same view as Assad in looking at all Syrian opposition groups as “terrorists.” Russia’s intervention has prolonged the conflict, shoring up Assad and delaying the defeat of ISIS.

“So far, based on what I’ve seen of targeting by Russia, Iran and the Assad regime they’ve really focused on rebel territories,” says Randa Slim, a director at the Middle East Institute. “They’re dropping more bombs on hospitals and schools in my opinion than on ISIS holdouts.” An assessment by Airwars, a non-profit project tracking international airstrikes against ISIS in Iraq and Syria, said between 1,700 and 2,300 civilians were killed by Russian strikes between September and January.

In late March, Russia backed Assad’s forces in retaking the city of Palmyra from ISIS, a rare instance of both governments taking on the terrorist group. A deal worked out between the U.S. and Russia was supposed to lead to military cooperation and intelligence sharing in the fight against both ISIS and Al Qaeda’s Syrian affiliate, but the deal fell apart within days of being implemented in September — along with a ceasefire.

The ensuing bombardment of Aleppo by Syrian and Russian forces led the U.S. Ambassador to the U.N., Samantha Power, to say on Sept. 25, “What Russia is sponsoring and doing is not counter-terrorism, it is barbarism.”