Shortly before its operatives killed 14 Iraqi Shia children in a school bombing this month, the group once known as al-Qa'ida in Iraq sent guerrillas into northern Syrian villages with orders to reopen local Sunni classrooms. In a series of early-autumn visits, the militants handed out religious textbooks and backpacks bearing the group's new name: the Islamic State of Iraq and Syria.
A four-hour drive to the east, a rival al-Qa'ida faction, Jabhat al-Nusra, was busy setting up a jobs programme in Ash-Shaddadi, a desert town it has held since February. The Islamists restarted production in an oilfield that had been closed by the fighting, and fired up the town's gas plant, now a source of income for the town.
The two rebel groups, with their distinct lineages to the terrorist network founded by Osama bin Laden, have concentrated Western fears of rising jihadist influences within Syria's rebel movement. Two-and-a-half years after the start of the country's uprising, Islamists are carving out fiefdoms and showing signs of digging in.
"We all have the same aqidah [Islamic creed] as al-Nusra or the Islamic State," said a 23-year-old Jordanian Palestinian who gave the name Abu Abdallah in an interview in Jordan and who fights for a rebel brigade allied with the Islamists. "The aim is to free the Muslim lands and have the Islamic flag there."
The prominence of the two groups — as fighters, as recruiters and, more recently, as local administrators — appears to have accelerated even as the Obama administration seeks to bolster moderate and secularist rebels with new weapons and training. Multiple independent studies, as well as Western and Middle Eastern intelligence officials, show the hard-line Islamists surging ahead by almost every measure, undermining Western efforts to find a democratic alternative to President Assad.
The al-Qa'ida affiliates have clashed with other rebel groups, and occasionally with each other, and their heavy use of foreign fighters and attempts to impose an ultra-conservative ideology have alienated some Syrians accustomed to secular rule.
"The situation is so bad," said Mohammed Abdelaziz, an activist in the city of Raqqa who says the Islamic State of Iraq and Syria — popularly known as Isis — criminalised the use of tobacco and carried out public executions. "A lot of people have just escaped the city, and many more are planning to."
But other Syrians have embraced the jihadists and welcomed the return of civil order. A 22-year-old Syrian fighter who called himself Abu Bahri said that about 100 people from his home town of Azaz joined Isis after becoming frustrated with the inefficiency of the more moderate Northern Storm Brigade. And the failure of the West to end the bloodshed has strengthened the message of extremists. "I support them because they hate the US, they hate the West, which has cheated us," said Mohammed Saeed, an aid worker from Palmyra based in the Turkish border town of Reyhanli.
"In Syria, [the Islamists] have a level of control they never enjoyed in Iraq," said Aymenn al-Tamimi, an expert on Syrian jihadist groups at the Middle East Forum, a Washington non-profit research organisation. In addition to their fighting and organising skills, he said, they appear to have absorbed lessons from Iraq, where al-Qa'ida's indiscriminate attacks against civilians horrified and repulsed ordinary Iraqis.
"They've learned that you do need some outreach to locals – you can't just entirely exploit them," Mr Tamimi said. A key part of that strategy, he added, is "outreach to children".
In the competition for local sympathies, the advantage so far belongs to Jabhat al-Nusra, an offshoot of al-Qa'ida in Iraq which has publicly aligned itself with Ayman al-Zawahiri, bin Laden's long-time deputy and his successor as the leader of al-Qa'ida. Since its founding early last year as a Syrian rebel group, Jabhat al-Nusra has played down its connections to the international terrorist movement while seeking to limit collateral damage from the suicide attacks and roadside bombings.
A much harder challenge confronts Isis — the rebranded terrorist group behind a campaign of savage attacks on Shia markets, schools and villages in neighbouring Iraq. The group's 8,000-strong Syrian contingent boasts a larger proportion of foreign jihadists than any other rebel group, according to analysts. In just six months of operations in the country, it has managed to frighten and enrage Syrians with its extreme interpretation of Islam.
Yet in recent weeks Isis, too, has sought to reform its image by reopening schools and delivering food, medicine and energy to war-weary towns. It has sponsored ice-cream-eating contests and tug-of-war competitions for children, and built training camps where teens learn fighting skills and participate in singalongs calling for the destruction of Assad and his allies.
Some Syrians who disapprove of Isis's religious zeal said they applauded the arrival of the disciplined, battle-hardened force if it could shift the momentum in a fight that has appeared deadlocked for months.
"If the Islamic State were organised and didn't interfere in people's lives, we would welcome them," said Mahmoud al-Hassan, a 30-year-old trader from Aleppo, who was visiting a hospital in neighbouring Turkey after his cousin was shot by a sniper.
To Western governments, the jihadists' entrenched position in Syria is another ominous turn. American and Middle Eastern officials say the two are a magnet for much of the foreign cash as well as the majority of the foreign fighters streaming into Syria.
But what troubles Western observers is not the groups' fighting prowess, but their shared vision of a jihad that extends beyond removing Assad. While other rebels fight to remove the Syrian dictator, former and current US and Middle Eastern officials say, the al-Qa'ida groups are transforming the conflict into a symbolic struggle against the West and Israel.
Abu Khaled, a 26-year-old Lebanon-born fighter, said the battlefield in Syria has expanded because of groups such as Isis, inspiring hope that the uprisings across the Middle East will give rise to a broader Islamic revolution. "We always said one of the main problems are the rulers, and now, see how one after the other is disappearing," said Khaled, who refused to give his full name. "And it won't stop until we get our aim."
The formal titles adopted by both al-Qa'ida groups include the Arabic term for greater Syria — al-Sham — that radical Islamists use to link their movement to the ancient Islamic caliphate that ruled a vast swath of the Middle East, with Damascus as its capital. Its use, the jihadists say, evokes an image of a future Middle East with a single Islamic state, encompassing the territories of Syria, Lebanon, Iraq, Jordan and Israel.
It is the groups' appeal to a greater jihad that explains why foreign volunteers continue streaming into Syria in numbers that surpass those seen during earlier conflicts in Afghanistan, Bosnia or Iraq, said Bruce Riedel, a former CIA officer and a Middle East adviser to four US administrations. "Syria has become the most important destination for aspiring jihadists ever, because it is the heart of the Muslim world on the border of Palestine," says Mr Riedel, now a senior fellow at the Brookings Institution. "For jihadis, it is the road to Jerusalem at last."
To terrorism experts, it was inevitable that an al-Qa'ida-aligned terrorist group would arise from the brutal sectarian violence of Syria's civil war. How the conflict came to have two competing al-Qa'ida factions is a story that reflects the power struggles within the jihadist movement in the decade after 9/11.
Yet despite the leadership rift and differences over tactics, the two factions cooperate more often than they clash, according to US and Middle Eastern experts.
"They operate in parallel to one another," said Aaron Zelin, of the Washington Institute for Near East Policy. "They have different command structures, and Isis uses more foreign fighters. But they swim in the same ideological waters."