In a former high school classroom in this northeastern Syrian town, about 250 Arab recruits for the US-backed war against the Daesh were being prepped by Kurdish instructors to receive military training from American troops.
Most of the recruits were from villages surrounding the Daesh's self-proclaimed capital of Raqqa, and the expectation is that they will be deployed to the battle for the predominantly Arab city, which is now the main target of the US military effort in Syria.
But first, said the instructors, the recruits must learn and embrace the ideology of Abdullah Ocalan, a Kurdish leader jailed in Turkey whose group is branded a terrorist organisation both by Washington and Ankara.
The scene in the classroom captured some of the complexity of the US-backed fight against the Daesh in Syria, where a Kurdish movement that subscribes to an ideology at odds with stated US policy has become America's closest ally against the extremists.
The People's Protection Units, or YPG, is the military wing of a political movement that has been governing northeastern Syria for the past four-and-a-half years, seeking to apply the Marxist-inspired visions of Ocalan to the majority Kurdish areas vacated by the Syrian government during the war.
Over the past two years, the YPG has forged an increasingly close relationship with the United States, steadily capturing land from the Daesh with the help of US air strikes, military assistance and hundreds of US military advisers.
The gains have taken Kurdish fighters far beyond traditionally Kurdish areas into territory populated overwhelmingly by Arabs, threatening not only to stir up long-standing ethnic rivalries but also a wider conflict.
Turkey, which regards the YPG as an affiliate of Ocalan's Kurdistan Workers' Party, or PKK, is enraged at the US support for the Syrian Kurds, and this month called on President-elect Donald Trump to sever US support for the militia when he takes office. As Russia, Syria and Turkey move closer toward a colony to the overall Syrian conflict, the United States could also find itself at odds with Russia over its military role in Syria.
To assuage Turkish concerns and avert tensions between Arabs and Kurds, the US military is channelling weapons and ammunition to an umbrella organisation called the Syrian Democratic Forces (SDF), which includes Arab fighters as well as the Kurds. The goal, the US military says, is to build an Arab force capable of taking and holding Arab cities such as Raqqa, thereby diluting the influence of the Kurdish fighters.
US officials and military advisers in Syria declined to discuss details of the training being provided to the Arabs in the force. But they said they were unaware that the Arab recruits were receiving lessons in Kurdish political theory before their US military training. "What happens to them before they come to us, we don't know," said one of the US military advisers in Syria, who spoke on the condition that he not identified by name or rank.
US officials acknowledge, however, that the Kurds constitute over three-quarters of the SDF coalition and are leading the fight on the front lines, making them the biggest beneficiary of US military assistance.
And it is the Kurdish vision of a future Syria that is being extended to the Arab areas that are being conquered, despite frequent statements issued by the US government opposing the Kurds' plans to create any form of new region in Syria.
"The military support has boosted the YPG's confidence to move beyond Kurdish populated areas and grow their ambitions even beyond Syria," said Maria Fantappie of the International Crisis Group. "It has huge political implications not only for Syria but also for neighbouring countries."
On a rare visit by foreign journalists to northern Syria, Kurds were eager to explain Ocalan's political theory, a mix of Marxism and the utopian dreams of a dead American leftist from Vermont named Murray Bookchin.
It seeks to abolish states and eliminate the need for governments by putting communities in charge of their own affairs. Referred to somewhat vaguely as "democratic confederalism" or the "democratic nation," the theory places a heavy emphasis on egalitarianism, women's rights and being kind to animals.
Originally envisaged by Ocalan as a way of achieving a form of autonomy for Turkish Kurds, who have historically faced severe discrimination by the Turkish government, the theories are now being adapted to the circumstances in Syria, with its diverse mix of Arabs, Kurds, Christians, Alawites, Turkmen and others.
Far from seeking to redraw borders to give Kurds their own entity, along the lines of the region carved out by Kurds in neighbouring Iraq, the Syrian Kurds are seeking to apply Ocalan's vision of a borderless world to all of Syria and beyond, said Nusrat Amed Xelil, who oversees the ideological training of the Arab recruits.
'We don't want confederalism just for Kurds, but for all Syria, and even all of the Middle East," he said. "We don't recognise geographical borders between this area and that."
In the classroom in Tal Abyad, a majority Arab town on the Turkish border that was recaptured from the Daesh in 2015, Kurdish instructor Agit Ibrahim Heso fielded questions from the slightly puzzled class of young Arab men, dressed in new green uniforms and seated at desks.
"What is the role of the state in the democratic nation?" one recruit asked.
"There is no state," Heso replied. "The state is an instrument of oppression."
"What's the difference between 'democratic nation' and the slogans of the Baath Party?" asked another recruit, referring to the party of President Bashar Al Assad that has ruled Syria for the past four decades.
The difference, the instructor explained, is that the Baath Party favours Arabs whereas Ocalan's theories apply to all ethnic and religious groups.
In interviews after the class, the men said they were happy to embrace the YPG's ideology.
"It is like having a democratic mother who does not discriminate against her children," said Louay Shammari, who escaped from a Daesh-controlled town in Raqqa province last summer.
"If we did not agree, we would not be in training now. We have to learn it," added Mussab Issa Sheikh, who is also from the Raqqa area.
Analysts and YPG opponents question how democratic or egalitarian the group's ideology really is. Dissent is not tolerated. Photos of Ocalan loom over town squares and in public offices, much in the way Assad's portrait dominates areas the government controls.
Though elected councils are administering day-to-day affairs in local communities, real power is wielded by shadowy military commanders who have fought with the PKK in Turkey, said Rana Khalaf, author of a report on the Syrian Kurds' governance for the London-based Chatham House think tank. "In practice, they are as authoritarian as anyone else," she said.
Kurds who support Kurdish parties that are opposed to the YPG have been jailed or driven into exile.
Those being targeted by the YPG also include people who support the mainstream Syrian opposition, according to an activist from the Arab town of Manbij, which was captured by the YPG and SDF last August. The activist has campaigned against both the Daesh and YPG, and the Kurdish militia wants him to turn himself in, he said. As a pressure tactic, the group is holding his brother, who is not politically involved, said the activist, who lives elsewhere in Syria and spoke on the condition of anonymity because he fears for his brother's safety.
Manbij offers an illustration of the potential contradictions of the US alliance with the Syrian Kurds. The town, located in the northern Syrian province of Aleppo, is held out by the US military as an example of a successful handover of power by Kurds to Arabs after an area is freed from Daesh control.
But the Arabs who run Manbij are adherents of the YPG's ideology, making them indistinguishable in Turkey's eyes -- and the eyes of local residents -- from the Kurdish force, according to Aaron Stein of the Washington-based Atlantic Council. The YPG-backed Arab force in Manbij has already fought battles with Turkish-backed Arab rebels in the nearby countryside, and Turkey is threatening to launch an offensive to take over the town.
At a recent ceremony for 250 Arab recruits who had just completed training with the US military near Manbij, the newly minted soldiers were told they would be heading not to the Raqqa front lines but to Aleppo, to confront the rebels backed by Turkey, a Nato ally of the United States. As US Special Operations troops looked on, Abu Amjad Al Adnan, commander of the Manbij recruits, rallied the soldiers to take the fight to the forces backed by Turkey.
US advisers are also present on the ground with the Turkish-backed rebels in Syria, setting up a scenario in which US Special Operations forces embedded with opposing sides could confront one another.
"We have taken prisoners who were trained by the United States and the Turks have prisoners of ours who were also trained by the United States," said Abu Amjad, who keeps a photograph of Ocalan as the screen saver on his phone.