BEIRUT, Lebanon — After they routed the army in southern Yemen, fighters from Al Qaeda stormed into the city of Al Mukalla, seizing government buildings, releasing jihadists from prison and stealing millions of dollars from the central bank.
Then they surprised everyone. Instead of raising their flags and imposing Islamic law, they passed control to a civilian council and gave it a budget to pay salaries, import fuel and hire teams to clean up garbage. The fighters receded into the background, maintaining only a single police station to arbitrate disputes.
Al Qaeda’s takeover of Yemen’s fifth-largest city in April was the most direct indication yet that the group’s most potent regional affiliates are evolving after years of American drone strikes killing their leaders and changing to meet the challenge posed by the Islamic State’s competing and land-grabbing model of jihad.
While the image of Al Qaeda has long been one of shadowy operatives plotting international attacks from remote hide-outs, its branches in Yemen and Syria are now increasingly making common cause with local groups on the battlefield.
In doing so, they are distancing themselves from one of Osama bin Laden’s central precepts: That fighters should focus on the “far enemy” in the West and not get bogged down in local insurgencies.
In recent weeks, the Qaeda affiliate in Yemen has allied with armed tribes to fight Iranian-backed Houthi rebels, putting that alliance on the same side of the country’s civil war as the United States and Saudi Arabia. In Syria, Qaeda-allied fighters are important members of a rebel coalition against President Bashar al-Assad that includes groups supported by the West.
This strategy has clear benefits for a group that has long been near the top of the United States’s list of enemies by allowing it to build local support while providing some cover against the threat of foreign military action.
But despite Al Qaeda’s increased involvement in local battles, American officials say the group remains committed to attacking the West, a goal that could be easier to plot from sanctuaries where it enjoys local support.
Cooperating with others could also give Al Qaeda a long-term advantage in its competition with the extremists of the Islamic State, analysts said.
Since its public break with Al Qaeda last year, the Islamic State, also known as ISIS or ISIL, has stolen the jihadist limelight by seizing cities in Syria and Iraq and declaring a caliphate in the territory it controls. This has won it the allegiances of other militant cells from Libya to Afghanistan.
The Islamic State has insisted that other groups join it or be considered enemies, a tactic that has alienated many in areas it controls. And its public celebration of violence, including the beheading of Western hostages, helped spur the formation of a United States-led military coalition that is bombing the group.
Al Qaeda’s branches in Syria and Yemen have taken a different route, building ties with local groups and refraining from the strict application of Shariah, the legal code of Islam, when faced with local resistance, according to residents of areas where Al Qaeda holds sway.
When Al Qaeda took over Al Mukalla in April, it seized government buildings and used trucks to cart off more than $120 million from the central bank, according to the bank’s director, Abdul-Qader Foulihan. That sum could not be independently verified.
But it soon passed control to a civilian council, giving it a budget of more than $4 million to provide services, an arrangement that made sense to local officials seeking to serve their people during wartime.
“We are not Qaeda stooges,” said Abdul-Hakeem bin Mahfood, the council’s secretary general, in a telephone interview. “We formed the council to avoid the destruction of the city.”
While the council pays salaries and distributes fuel, Al Qaeda maintains a police station to settle disputes, residents said. It has so far made no effort to ban smoking or regulate how women dress.
Nor has it called itself Al Qaeda, instead using the name the Sons of Hadhramaut to emphasize its ties to the surrounding province.
One self-described Qaeda member said that the choice of name was deliberate, recalling that after the group seized territory in southern Yemen in 2011, the country’s military had mobilized to push it out with support from the United States.
“We were in control for a year and six months, we applied God’s law, we created a small state and the whole world saw it, but they did not leave us alone,” the man said in an interview with a Yemeni television station. “So we came here with the name the Sons of Hadhramaut, but the people here know who we are.”
American officials have long considered the terrorist group’s Yemeni branch, known as Al Qaeda in the Arabian Peninsula, the most dangerous to the West. It has sought to carry out attacks against the United States, and it retains sophisticated bomb-making expertise.
Now, Yemen’s civil war has given the group an opportunity to expand, analysts said.
After Houthi rebels seized the Yemeni capital and forced the president into exile, Saudi Arabia began leading a bombing campaign aimed at pushing the Houthis back. With all that going on, no one has tried to dislodge Al Qaeda from Al Mukalla, although American drone strikes have killed top Qaeda leaders nearby.
April Longley Alley, a Yemen analyst with the International Crisis Group, said there was reason to worry that the close ties between Qaeda fighters and other armed elements meant that any foreign military support given to fight the Houthis could eventually end up in Al Qaeda’s hands.
“It is very likely that if the war continues, we’ll see a dynamic like we have seen in other parts of the region, where money and arms given to an opposition movement bleed out to other groups,” she said.
An American intelligence official said that Al Qaeda’s senior leadership had suffered losses in recent years, diminishing its importance and giving greater autonomy to the affiliates, some of which still pursue attacks on the United States and its allies.
While Qaeda networks in South Asia and North Africa have struggled to recover from the losses of leaders, resources and territory, Yemeni and Syrian branches have “gained momentum and, in some cases, more resources due to ongoing instability,” the official said, on the condition of anonymity because he was not authorized to speak to journalists.
Syria’s Qaeda affiliate, the Nusra Front, has made itself an essential component of the rebel forces seeking to oust Mr. Assad. It recently joined a rebel coalition called the Army of Conquest, putting itself in the same trenches as groups that receive support from the West.
“They are Muslims, no different from us,” said Abu Mohammed al-Jolani, the Nusra Front’s leader, in a recent interview with Al Jazeera.
He also said his group had been ordered by Ayman al-Zawahri, Al Qaeda’s global leader, not to carry out foreign attacks that could disrupt the fight against Mr. Assad.
American officials called that propaganda, and the United States has bombed Nusra bases, saying it is targeting operatives focused on attacking the West. But the strikes have been criticized by other rebels, reflecting the Nusra Front’s importance to the rebel cause.
The group has worked to strengthen those ties to bolster its might against the government and the Islamic State, according to a Nusra Front coordinator based in northern Syria.
Such cooperation also allows the group to benefit from arms given to other rebels.
“The mujahedeen need sophisticated weapons, and the West provides these weapons to whomever it thinks is able to carry out its agenda,” said the coordinator, who goes by the name Abu Omar al-Muhajir and was interviewed via text message.
Civilians living in Nusra Front areas, too, say the group has built local support, refraining from imposing Shariah when residents resisted.
Meanwhile, its fighters have distributed food and fixed plumbing systems. In the village of Binnish, it recently fielded a team in a friendly soccer match against another rebel group. Nusra’s team wore fatigues in line with Islamic modesty, and it lost against players wearing shorts.
“Nusra are not extremists,” said an activist who attended the game and gave only his first name, Najid. “They distribute leaflets at checkpoints and call people to the religion.”
Others worry that the group is merely laying the groundwork to eventually impose its will.
“I am worried that after all the gains the Nusra Front has made in the past four months and the notable increase in popular support, locals will tolerate and accept the Nusra Front’s way of governing the liberated areas,” said Hasan al-Ahmed, an activist in the town of Kafr Nubul.
Karam Shoumali contributed reporting from Istanbul, Hwaida Saad from Beirut, and Eric Schmitt from Washington.