America’s most effective ally on the ground in Syria is defecting to its chief adversary in the war against the Islamic State group, risking the very foundation of the U.S.-led effort to defeat the extremist network. At least some elements of the Kurdish YPG, the militant arm of the main Kurdish political body in Syria, are now operating with the Russian military in support of the regime of Bashar Assad and his Iranian backers. Sen. John McCain, the powerful chairman of the Senate Armed Services Committee, says the Obama administration has mishandled the critical relationship with the YPG and now is paying the price.

“I’m confident it’s not all the Kurds, but there is a segment that has aligned with the Russians because they want to win, and they see the Russians succeeding where we have failed,” McCain told a group of reporters last week. “Now we are faced with a dilemma … because they think that’s the best way of winning.”

The Arizona Republican is one of a series of coalition officials, analysts or observers who believe America’s self-imposed restrictions for the bloody conflict in Syria have forced the Kurdish fighters on the ground to look for other sources of international support to achieve their goals.

Losing the Kurds would hurt whatever hopes the U.S.-led coalition has of finding victory on the ground in Syria. Fighting units like the YPG have been among the most successful in a war to which Obama has refused to deploy large ground forces. Amid the failed U.S. effort to build an army in Syria of its own, the Kurds are now among the only groups left capable of making such gains.

This problem is magnified by the fact that the powers intervening in Syria have differing priorities. The U.S. wants to defeat the Islamic State group while keeping out of the ongoing Syrian civil war. Turkey, a NATO ally providing a critical base for American warplanes, wants to overthrow the Syrian regime of Bashar Assad, supported now by Russia and Iran and to keep the regional Kurdish population under control.

Meanwhile, the chief priority of the Kurds – an ethnic group of about 25 million to 30 million spread out across Syria, Turkey, Iran and Armenia and a semiautonomous region within Iraq – is securing a territory they can claim as their own when the fighting stops. And they largely don’t care who helps them.

“They would have rather confirmed the U.S. to be their partners, but now Russia is there with robust bombardments and strikes,” says Doga Eralp, a lecturer at the American University School of International Service who believes all warring parties are now jockeying for a position to determine who controls which areas in Syria after some form of cease-fire. “They know their eventual seat at the negotiating table would be secured if they start cooperating with the Russians on the ground. But they wouldn’t openly say that.”

The Kurds don’t have to. Recent combat maneuvers indicate they’re at least coordinating with forces loyal to the Assad regime, trained and supported by Russian special operators and protected by Russian airpower overhead. (Some reports even indicate Syrian opposition fighters have heard Kurdish radio chatter calling in Russian airstrikes directly – but those are unconfirmed and would align with previous false claims the opposition has made.)

For example, when the YPG liberated the Syrian town of Tell Rifaat in mid-February – less than 20 miles north of the opposition stronghold of Aleppo and roughly halfway from Aleppo to the Turkish border – regime forces simultaneously moved on the two villages of Ahras and Misqan to the south of the town, supported by Russian airstrikes.

Neither set of forces engaged one another, which would have been a common outcome if they fought on opposing sides. This serves as enough evidence for Chris Kozak, an analyst at the Institute for the Study of War, to believe that the two sides are at least passively aligned.

“They aimed at different military targets, but in a coordinated way,” Kozak says.

For the Syrian regime and its international allies, this works well. They wish to create a buffer between themselves and the opposition in the north as well as the Turks. The regime doesn’t need to push toward the border and engage Turkey – possibly provoking other NATO allies in the process – if it can get the Kurds to do that for them.

Regime support also helps Kurdish positions squeeze both sides of the Islamic State group’s sole remaining corridor to the Turkish border north of Aleppo, through which it smuggles fighters, money and supplies to its so-called caliphate. The extremists’ access to the border is abuted by opposition-controled territory also accessible to Turkey, through which it can receive weapons and supplies from Ankara.

(A map generated by the U.S. led coalition earlier this month shows some of the different warring groups’ locations.)

Further complicating the process is America’s sticky relationship with the YPG and its parent political organization, the PYD. The U.S. needs Turkish support, not in the least to keep warplanes at Incirlik air base as one of the only nearby hubs for its air war against the Islamic State group.

But the Turkish government fervently believes the YPG is aligned with another Kurdish group within Turkey, the PKK, which both the U.S. and Turkey consider a terrorist organization. Turkey acted on these fears after it finally succumbed to U.S. pressure to join the multi-nation coalition it’s built by immediately attacking Kurdish positions – not the Islamic State group. With Kurdish troops now moving toward the Turkish border, Obama is left in the impossible position of having to support two groups he needs as proxies but who oppose one another.

“We believe the YPG is not affiliated with the PKK,” State Department spokesman Mark Toner repeated last week when pressed on the issue. He added a caveat indicative of how the administration has tried to avoid taking sides: “However, we recognize Turkey’s concerns over PKK and terrorism on the ground and its right to defend itself, but we have urged it to stop shelling over the border.”

Toner said the U.S. has called on the YPG to stop “taking actions on the ground in and around Aleppo” that he called “counterproductive.”

This straddling policy leads to awkward diplomatic incidents, such as when the U.S. denied a visa to PYD emissary Saleh Muslim last year.

But the PYD has since expanded its diplomatic options. Earlier this month, it announced it had opened a delegation office in Moscow.

“Our aim is to strengthen and develop relations with the Russian side, including its civil organizations, political parties, academics,” its chief delegate, Abd Salam Muhammad Ali, told Russian state-sponsored news agency RT. An envoy for the Syrian Kurds told Bloomberg that Russia had committed to protect Kurdish fighters from Turkey, a pledge it may have to fulfill following reports at the end of February Turkey shelled a Kurdish town near the border.

The delicate balance the U.S. is trying to strike between the Turks and the Kurds has left a perfect gap for Russia to further harass the U.S. and to exact revenge on Ankara amid heightened tensions between the two countries, which nearly devolved into all-out war when Turkey shot down a Russian fighter jet that briefly crossed over into its territory. Moscow, Tehran and Damascus also can now offer the Kurds something Washington can’t: a contiguous region across Syria’s north that would connect Kurdish-liberated areas from Afrin in the northwest, to Kobani, to al Hasakah province in the northeast.

“We’ve over-relied on the Kurds,” says Kozak. “In over-relying on the Kurds, we’ve put our eggs in one basket, and that is a basket that’s limited our opportunities.”

Kozak worries about what happens if the Kurds miscalculate and, as the Russians found out when they flew a plane too close to the border, incur a stronger military response from the Turkish government and President Recep Erdogan.

McCain agrees.