CAIRO - When al Qaeda overran the Yemeni port city of Mukalla last month, the group's commanders immediately struck a deal to share power with the area's tribesmen. No jihadi banners were raised. Al Qaeda even issued a statement denying rumors that it had banned music at parties or men wearing shorts.
A local tribal council now administers the city.
The approach was a stark contrast to al Qaeda's rival, the Islamic State of Iraq and Syria (ISIS), notorious for its savagery. And that was precisely the point.
In a competition with ISIS for recruits and prestige across the Middle East, al Qaeda has sought to distinguish itself from its rival's bloodthirstiness, taking an approach that in jihadi circles would be considered pragmatic. It is building alliances with local players, even old enemies, to seize new territory. Its leader, Ayman al-Zawahri, has told his followers to avoid ISIS-style brutalities against civilians in order to build support among local populations.
The strategy has paid off, winning new gains for al Qaeda. In Yemen, it even stands to emerge as the real winner as Saudi Arabia leads an Arab air campaign targeting the terror network's rival, the Iranian-backed Shiite rebels known as Houthis who have taken over much of the country.
Al Qaeda "is the future Trojan horse," warned a senior Yemeni military intelligence officer, Ali Sharif. When the war is over and leaves a security vacuum, he said, "the role of al Qaeda will come. ... They will fill it and take control."
While the United States and the West might hope that the competition between al Qaeda and ISIS would weaken two major militant threats, each is instead maneuvering to benefit from the region's turmoil.
ISIS' gains over the past year have been sizeable. For nearly two decades, al Qaeda was unchallenged as the world's most prominent terrorist organization. But ISIS has stormed forward to rival it - and even surpass it in places.
Beyond its heartland in Syria and Iraq, ISIS has planted flags across the map. It eclipsed al Qaeda in Libya, where ISIS' strongest external branch controls several cities and most of al Qaeda's one-time allies have switched to swear fealty to it. Militants in Egypt's Sinai Peninsula and Nigeria's fearsome Boko Haram - all once linked to al Qaeda - have also pledged allegiance to ISIS leader Abu Bakr al-Baghdadi.
Perhaps more importantly, ISIS has a dynamism and fervor that has seemed to fade for al Qaeda. The ISIS declaration of a "caliphate" in Iraq and Syria inspired a stream of thousands of foreign fighters to join it and earned it pledges of allegiance by individual militants around the region. The group's notorious brutalities - everything from beheadings to enslavement of women from religious minorities - are seen by its supporters as proof of its purity and refusal to compromise on what it considers "God's law."
That has helped ISIS aggressively make inroads in areas long the domains of its rivals.
In Afghanistan, where the Taliban, a top al Qaeda ally, has long dominated, young militants frustrated with the lack of progress in a nearly 14-year insurgency see a winner in ISIS. In February, former Taliban commanders in southern Zabul province "exchanged their white Taliban flag for the black flag" of ISIS and were behind the abduction of 31 Shiites, according to Afghanistan's senior Shiite leader, Mohammad Mohaqiq.
"This is a very fertile breeding ground" for ISIS, said Nader Nadery, director of the Afghanistan Research and Evaluation Unit think tank.
Around the Middle East, prominent jihadi clerics to whom militants look for guidance have been split, lining up with one side or the other. The bitterness spills out on social media, where the two sides hurl insults at each other.
Al Qaeda backers gloated when Iraqi troops and Shiite militiamen retook the Iraqi city of Tikrit from ISIS last month. "After all the blood spilled over the delusion of the caliphate, have you finally realized that declaring a nation and emirates only hurts Muslims and jihad?" asked one, with the Twitter handle Jabal al-Aiza.
ISIS supporters in turn accused al Qaeda of siding with enemies of Islam against the caliphate. A pro-ISIS figure on Twitter, Abu Khatab al-Yemeni, denounced al Qaeda's branch in Yemen for allying with anti-Islamist militias that "once were considered apostates."
By building such partnerships, al Qaeda is essentially betting that ISIS will burn itself out and be weakened by bearing the brunt of the Arab and Western military backlash against its caliphate, while the terror network gains ground through its alliances.
Al Qaeda's approach hardly makes it more moderate, though. In a 2013 document called "General Guidance for Jihadi Action," al Qaeda leader al-Zawahri underscored that the group's priority is to strike "the head of the infidels, the United States and Israel, and their local (Arab) allies."
At the same time, the document urges al Qaeda militants to avoid bloody killings of civilians in order to build support among local populations. They are not to kill Shiite civilians - even though the group considers them infidels - or the families of opponents. They are not to harm Christians or bomb mosques or other places where civilians gather.
In Syria, al Qaeda's Nusra Front is the most powerful fighting force outside the territories held by ISIS. Last month, it worked with other rebel factions, including ones backed by Saudi Arabia, Turkey and Qatar, to capture the northwestern city of Idlib and territory in the south - the biggest victories in several years over President Bashar Assad.
In Yemen, al Qaeda has been boosted by the fight against the Iranian-backed Houthi rebels, who overran the capital, Sanaa, and much of the north and are fighting to take the south after driving the internationally recognized president, Abed Rabbo Mansour Hadi, out of the country.
Al Qaeda "has emerged as the only real fighting force countering the Houthis," said Adaki Oren, an analyst with the Long War Journal, which monitors militant groups. "They have championed themselves as the vanguard of Sunni tribes."
The militants overran Mukalla, the capital of Yemen's largest province, Hadramawt, in early April. That brought it a flood of weapons and cash. But the group quickly stepped into the background. An umbrella group known as the Sons of Hadramawt is policing the city, made up of tribal fighters, local youth and al Qaeda militants. A local council is running government institutions in the city and even won the support of Hadramawt's pro-Hadi governor, who also has fled abroad, a spokesman for the council, Lutfi bin Saadon, told the AP.
When rumors circulated that al Qaeda was imposing strict Shariah rules in the city, including banning music at parties and forbidding use of "qat," a stimulant leaf chewed by Yemenis, the group issued a statement denying the reports and saying they were spread by those opposed to the tribes cooperating with al Qaeda.
The group says it is avoiding taking over territory to rule itself because that would distract it from fighting the Houthis and from its ultimate goal of targeting the United States - and perhaps draw U.S. drone strikes that have taken out a string of its prominent figures.
Still, its influence among local fighters worries some Yemenis. Across the south, it has allied with local militias, giving backbone to anti-Houthi fighters.
"Sleeper cells of al Qaeda are now awakening, thanks to Houthis," said a southern activist, Adnan Agam. "The south will become a new Afghanistan. ... It won't be one or two cities under al Qaeda control, but all of the south."