Rebels linked to al-Qaeda are surging in Syria, but Kurdish fighters recently rolled back some of their gains. A tour through the newly won territory gives a rare look at life under the extremists — and a window into their vision for Syria. "It's a black-and-white world for them. You can become their enemy very fast."

Yusuf Sayman for BuzzFeed Painted-over graffiti in Yarubiya, Syria.

YARUBIYA, Syria — The jihadis scrawled their graffiti all over town. Black spray paint extends across wall after wall, spelling out religious exultations and verses from the Quran, written out in exacting calligraphy. It runs along the gates of shuttered storefronts; it's stenciled onto telephone poles. It covers the former state security building, burned out and bullet-ridden, that was converted into an Islamic court. Until recently, armed jihadi groups ran the dusty Syrian town of Yarubiya, pressed into the northeastern corner of the country, the gateway to a crossing into Iraq. The groups are gone now — driven out by Kurdish fighters in late October — but their graffiti remains, still visible beneath fresh layers of paint. The names of the fighting groups, like the Quranic verses, are also written everywhere, and they serve as a reminder: Al-Qaeda was here. Rebels descended on Yarubiya and pried it from the Syrian regime in March. Most residents fled. Those who stayed recall a foggy transition among the town's new overlords: Fighters who seemed moderate at first were replaced with — or superseded by, or became themselves — fighters who were ardently Islamist. Most belonged to Jabhat al-Nusra, the powerful force blacklisted by the U.S. as a branch of al-Qaeda; others to the Islamic State of Iraq and Syria, or ISIS, now the most feared group in the rebellion. In a large warehouse near the border, the names of these two groups are stenciled onto metal plates, the writing neatly packed beneath the Muslim declaration of faith: "There is no god but God, and Muhammed is the messenger of God." The plates provided a clue to the jihadis' main aim, a Kurdish policeman said, explaining that they were to be installed atop the yellow poles that stand outside the warehouse, overlooking Iraq. "They wanted to take part from here, and part from there," he said, motioning across the border, "and become the Islamic State."

Yusuf Sayman for BuzzFeed Residents who fled rebel rule in Yarubiya began to return home on Friday.

The rebels' transition in Yarubiya mirrored that of their counterparts across the country. Reliant on foreign jihadi fighters and money from the Gulf, and feeling abandoned by the U.S. and the West, the armed opposition has become increasingly Islamist. This religious turn has fragmented the rebellion, as extremist groups push to carve out their own territory and impose their interpretation of Islamic law. Charles Lister, an analyst at IHS Jane's Terrorism and Insurgency Centre in London, calls Syria "the most valuable opportunity in a long time" for groups linked to al-Qaeda. "[They] have expanded steadily in Syria since the spring. And they are pushing for more territory, with a mind to military operations as well as governance." But in Syria's Kurdish region, near the Turkish and Iraqi borders in the northeast, the surge in extremist influence has been rolled back, with well-organized Kurdish fighters winning a string of important strategic victories of late. The newly won territory offers a rare window into life under the control of the rebellion's most powerful extremist groups, and a glimpse of their vision for Syria. "It was like Afghanistan when we came here," said Nafath Abdel Aziz, the Kurdish official now running Yarubiya's security. Locals say they were forbidden from listening to music and forced to fast and pray. One man, who owns a grocery shop on the town's main road, spent two nights in jail for smoking a nargila. Bread prices skyrocketed, and fuel became scarce. Residents tried to avoid confrontation. "It's a black-and-white world for them. You can become their enemy very fast," the grocer said. One day this summer, at the intersection outside the grocer's shop, the jihadis trotted out two dazed-looking men — one young, the other maybe in his fifties — and presented them as agents of the Syrian army. The accused might have been sedated; they put up little resistance as the jihadis cut off their heads. The grocer stood and gawked. Another man recounted vomiting on the street. Another, 25-year-old Taha Yasin, said he recorded the incident on his cell phone. Asked about the video, he replied, "I deleted it, sheikh" — using the honorific for Islamic scholars, by mistake. Embarrassed, Yasin explained that this had become a habit: "They ordered us to call them sheikh. And if you didn't say sheikh, then you had a problem."

Yusuf Sayman for BuzzFeed Locals rebuild damaged homes in Yarubiya.

On Friday, residents who'd fled started returning to Yarubiya. Security forces and cleanup crews had spent the previous weeks painting over graffiti and clearing away explosives and debris. Carloads of families rumbled down the highway leading to town, which wound through farm fields lined with tank ditches. Flatbed trucks were piled high with furniture; one was packed with a flock of sheep. "I feel that I am born again," said Ramadan Abdel-Latif Mustafa, passing through the town's checkpoint with his wife and six kids. Back in town, the new arrivals ambled past the destruction and reopened boarded-up homes. Some had been looted, and belongings were strewn across the ground of a nearby warehouse — an overturned armoire, spilling out girls' clothes; a scattered deck of Uno cards; a medical dummy, opened up to reveal his insides. Kurdish security officers picked through the mess, as if in a daze, examining the clothing, tapping at a dusty tambourine. Sunlight filtered into the warehouse through bullet holes in its metal siding, and spent mortar shells sat in the parking lot outside. About half of Yarubiya's pre-war population were Kurds. The group makes up 10% of Syria's population, and they've historically been oppressed, unable even to register children with the government if they gave them Kurdish names. Kurds want to stay out of the civil war — in order, they say, to keep their towns and cities from being destroyed, as regime forces pummel any area with a rebel presence, even bombing the capital with warplanes. This gives the Kurds a unique vantage point in the conflict: caught in the middle, and wary of both sides.

In Qamishli, the region's largest city, as elsewhere in the area, the regime has largely pulled back, fueling accusations from the opposition that the Kurds are collaborators. But the city seems stuck in an uneasy détente. Though the Kurds run much of it, the regime keeps a presence, controlling certain neighborhoods, the airport, and the main road and square. Kurds tense up as they drive past regime security forces, clad in black. At a Kurdish security headquarters, which is protected by roadblocks and armed guards, a Syrian flag flies from a building just across the street, indicating regime territory. "They know not to attack us, because we are strong. But there is no peace," Giwan Ibrahim, a senior official with the Kurdish security forces, said from his office there. "There is only a balance of power." Rumors fly about the jihadis, meanwhile, whom the Syrian Kurds often refer to as "terrorists" and "savages." They talk of warriors wearing long beards decorated with beads. They say the jihadis keep keys around their necks and spoons in their pockets — to enter the gates of paradise if they're martyred, and to dine with the Prophet Mohamed when they arrive. "They have nothing in their heads but dying and going to heaven," Ibrahim said.

Yusuf Sayman for BuzzFeed Kurdish fighters near Ras al-Ain, Syria.

The Kurdish militia, called the People's Defense Units, or YPG, claims to have more than 45,000 fighters. Whatever its true numbers, years of training and a stockpile of arms make it a potent force. Rebels at first respected Kurdish wishes to be left alone, and after a flare-up of fighting late last year, an uneasy truce held until summer. Then rebel groups, led by Jabhat al-Nusra and ISIS, turned their sights to Kurdish land, which is valuable for its oil wells and border posts. Many extremists also regard the Kurds as infidels, and are suspicious of their ambitions for autonomy, on top of their alleged cooperation with the regime. "Jihadis perceive them as an ever-present threat," said Lister, the analyst with IHS Jane's. Fighting erupted this summer between Kurds and rebels in Ras al-Ain, a city 70 miles west of Qamishli. Unlike in Yarubiya, where the YPG waged a strategic battle of choice, rebel aggression in Ras al-Ain made it a battle of "survival" for the Kurds, says Sirwan Kajjo, a Syria analyst with Caerus Associates, a research firm in Washington, D.C. Rasgin Ahmed, a 46-year-old farmer and father of four from a nearby village, decided to pick up a weapon for the first time in his life. He had a short training session, learning to handle an assault rifle and operate its safety, and then headed off to battle, deeply afraid. "Whoever says he's not afraid when he goes to fight is the biggest liar," Ahmed said from an encampment at a checkpoint near Ras al-Ain one recent night. "I was forced. There was only one thing in my mind: not to let any foreigners take my land." Like other Kurdish fighters, Ahmed recounted aspects of the jihadis' fighting style with a lingering awe — firing rocket-propelled grenades from the middle of the street, unconcerned with taking cover, or spraying bullets as if they were in unlimited supply. Seasoned soldiers say the fighters can also display a deadly efficiency, with well-trained snipers and expert use of heavy weapons and tanks. "Their snipers are so good," said one 23-year-old fighter at the Ras al-Ain checkpoint, holding up a bandaged hand to make his point.

Yusuf Sayman for BuzzFeed Destruction from fighting near the Turkish border in Ras al-Ain, Syria.

All around Kurdish Syria, songs heralding the YPG blared constantly from car stereos, and shrill voices on the radio urged on the fight against the "terrorists." One night, a funeral procession for a YPG soldier drew crowds as it traveled from Ras al-Ain to Qamishli. A white van led the procession, its back doors open to reveal a coffin surrounded by women in black. A caravan of pickups followed, soldiers and supporters overflowing from the beds, cheering and waving flags. Another truck carried speakers stacked high into the air, precariously secured with bungee cords, blaring bass-heavy anthems to the YPG. At the endless series of checkpoints that dominate the area, though, the mood was often one of great unease. Bomb attacks by the jihadis have become a deadly problem, with Kurdish officials putting the number at 50 since July, though they seemed unsure of the true figure. There have been car bombs, suicide blasts, and IEDs planted on the roadside, with the deadliest attack to date hitting the city of Ayn al-Arab earlier this month, leaving 14 civilians dead. Ibrahim, the security official, said he expected the attacks to continue as the YPG drove the jihadis back, with tactics honed in places like Iraq and Afghanistan making their mark in Kurdish Syria. "We have got no experience or technology. So we use primitive ways to protect ourselves," he said.

Yusuf Sayman for BuzzFeed Metal ball bearings in Yarubiya, used to make extra shrapnel for bombs.