Foreign fighters from across the Arab world and beyond are playing an increasingly dominant role in the battle for control of Syria, which has emerged as an even more powerful magnet for jihadist volunteers than Iraq and Afghanistan were in the past decade.

But the flow of jihadist volunteers has accelerated, and non-Syrians have begun taking the lead in a variety of roles as the al-Qaeda-affiliated Islamic State of Iraq and Syria (ISIS) attempts to assert control over large areas of the rebel-held north.

Foreign fighters man checkpoints, serve as commanders on the battlefield and have become the de facto rulers of towns and cities in areas under rebel control, giving them a visible and much-feared presence across large swaths of territory, according to Syrians living in the north as well as analysts.

Saudis, Tunisians and Libyans are among the most frequently encountered nationalities, the residents and analysts say, but men from Chechnya, Kuwait, Jordan, Iraq and the United Arab Emirates also are present. The Pakistani Taliban announced in August that it had established a presence in Syria. Among those killed in recent battles was a Moroccan commander who had spent years as a prisoner of the U.S. government at Guantanamo Bay, Cuba, and was eulogized in one of the many videos prepared by the foreign volunteers to advertise their presence.

In another, a bearded fighter croons about martyrdom beside a swimming pool in the northern province of Latakia. “Here are the future martyrs swimming, and I dedicate this song to them,” he sings as men splash in and out of the turquoise pool. “Prepare the bombs and put them on my body.”

Conservative estimates put the number of foreign fighters who have entered Syria in the past two years at 6,000 to 10,000, a range that exceeds the number who volunteered to fight U.S. troops in Iraq or Afghanistan, said Brian Fishman, a former counterterrorism official who served in Iraq with West Point’s Combating Terrorism Center and is now a fellow at the New America Foundation.

The biggest influx of foreign fighters into Iraq occurred in 2006-2007, when more than 600 crossed in, he said. Many were recruited as suicide bombers and swiftly removed from the battlefield.

“There’s a lot more foreigners than we ever saw in Iraq, and there’s going to be a lot more,” Fishman said of the situation in Syria. “They control territory, they’ve established governance . . . and you see these foreigners playing more dynamic roles. They’re getting trained and leading people and illustrating a level of ability we didn’t see in Iraq.”

The implications for the United States and its Western allies are evident, said Nada Bakos, who tracked al-Qaeda for the U.S. government in Iraq and Afghanistan. Jihadists have secured more territory in Syria than they were able to do in Iraq or Afghanistan, and “anywhere they set up anything remotely resembling a safe haven, it’s a problem for the West,” she said.

The influx of foreigners has inevitably stirred tensions with local residents, who resent the intrusion as well as the rigid interpretation of Islam that the al-Qaeda-influenced fighters have sought to impose on Syria, which has traditionally been conservative but far from extreme.

Clashes have erupted with increasing regularity in recent weeks between units largely loyal to the umbrella Free Syrian Army, which states that the overthrow of Assad’s regime is its main goal, and the Islamists, who have made it clear that their chief ambition is the establishment of an Islamic state across the Muslim world.

The most serious of the recent fights occurred in the town of Azaz in northern Aleppo province, near the Turkish border. The town was briefly overrun by fighters from the Islamic State late last month. A truce — signed on behalf of the ISIS by a Chechen and a Kuwaiti — has brought about a tenuous calm.

In recent days, the ISIS has further antagonized local populations in northern Syria by announcing bans on the use of tobacco. Moderate Free Syrian Army groups have been driven out of the city of Raqqah in battles that residents say were led by a Libyan commander.

An Iraqi who appears to be young and short and uses the name Abu Hamza wields overall control over the city and moves around with convoys of expensive cars and bodyguards, said Aram al-Shami, 24, an activist who travels regularly between Raqqah and Turkey and uses a pseudonym because he fears the Islamists.

Along the route, checkpoints manned by ISIS fighters, mostly from Saudi Arabia, Libya and Tunisia, stop travelers, search their cars and ask questions with unsmiling severity. “Who the hell are these guys to come to another country and tell us what to do? It really makes us mad,” Shami said.

Rifts have also emerged between the more radical Islamic State and Jabhat al-Nusra, the original Syrian al-Qaeda affiliate that has since sought to cast itself as the more moderate — and Syrian — of the two. But although an alliance announced last week between Jabhat al-Nusra and more-secular rebel groups was cast by some as an attempt to create a front against the ISIS, an organized effort would need a far greater influx of money, support and enthusiasm from fighters on the ground, most observers say.