Here and elsewhere in the country’s central and southern regions, American-backed Yemeni forces have been waging a shadow war against more than 3,000 members of the Qaeda affiliate and their tribal fighters. Since Feb. 28, the United States has conducted more than 100 airstrikes against Qaeda militants in Yemen, according to the Pentagon, nearly three times the total for all of last year.
The Yemenis in recent weeks have also captured some important Qaeda operatives. Their interrogations have given the Yemeni forces and their American and Emirati partners valuable insights into the insurgents’ leadership hierarchy, propaganda plans and local networks, a United States official said.
Here in Azzan, Mr. Wahidi said that residents had been tipped off about the impending attack by homegrown troops in the advancing force. “Those are our sons,” Mr. Wahidi said as he reclined on a hard pillow and chewed khat, the narcotic leaves widely consumed in Yemen and the Horn of Africa. “Most of the soldiers graduated from Azzan secondary school.”
The night before, residents said, warplanes hovered over the town and dropped flash bombs at suspected Qaeda militants gathering in the nearby mountains. Ahead of their arrival, the Yemeni troops also fired machine guns that rocked the town, another tactic to scare the militants.
As the insurgents melted away, the Yemenis marched toward a military camp on a small hill overlooking Azzan that the Qaeda fighters had used. Mohammad Al Qumishi, the commander of the forces, locally known as Shabwani Elite Forces, bragged about the success of his troops in hunting down senior Qaeda operatives in Shabwa.
“We have captured eight big heads,” said Mr. Qumishi, adding that local residents who sold arms to Al Qaeda were released after pledging to no longer deal with the militants.
The Shabwani force is made up of 4,000 local tribesmen who fought off Shiite militia in northern Yemen in 2015. The forces were trained by Emirati military instructors in a desert area of nearby Hadramout Province, and took orders from the Emiratis during the recent offensive. An unidentified number of other troops are being trained in the same area.
Months before, the Emirati trainers promised local tribal leaders that the Emirati Red Crescent would dole out money to revive crumbled social services if the local fighters helped push Al Qaeda from their territory. The elders agreed, and the town’s main schools and hospital were painted on time, but teachers and other public servants who would run these facilities say they have not been paid in several months.
Yemen analysts say counterterrorism may not be the only motive driving the offensive here. Shabwa is home to major oil and gas facilities that are being reopened and involve international companies, which means commercial interests may also be at stake, said Elisabeth Kendall, a Yemen scholar at the University of Oxford who visited the country in August.
That said, Ms. Kendall noted that there are clear signs that the offensive has put a dent in Al Qaeda’s fortunes. The group publicly warned residents in August against joining the Emirati-led Yemeni forces. “It attempts to merge A.Q.A.P.’s religious agenda with local tribal concerns, distilling a complex political landscape into a simple apocalyptic battle of good guys versus bad guys,” she said, referring to Al Qaeda in the Arabian Peninsula.
The streets of Azzan, a commercial gathering place for thousands of people from four neighboring districts in Shabwa, are unpaved and dusty. Trash covers the ground, the result of years of uncollected garbage. Electricity works for only about five hours a day. Water is also unavailable most of the day. On working days, Azzan is packed with thousands of shoppers; during the weekend in Yemen, the streets are nearly empty except for some passing African immigrants.
Tough-looking soldiers manning two checkpoints at the entrance to the town carefully check cars and search for weapons or cameras. Armed tribesmen must relinquish their guns if they wish to enter. Celebratory gunfire during nighttime weddings was banned. The result is that security has improved for the first time in years, residents said.
The town has held significance since 2011, when Qaeda militants seized control here, exploiting a security vacuum as the government of Yemen’s long-serving president, Ali Abdullah Saleh, faced major protests during the Arab Spring calling for his ouster.
Yemeni government forces launched a major military offensive and recaptured the town in 2012. The militants withdrew to the mountains and from there plotted a deadly counteroffensive.
The militants reclaimed Azzan in 2013, but this time under the pretext of stopping thugs who had robbed and killed local people. At the same time, the militants made concerted efforts to fix public services like electricity, water and sanitation. Steel trash bins brought in by the Qaeda fighters are still scattered in the city’s dirty streets.
In 2014, Yemen’s army launched yet another offensive and retook the town. In the following months, militants mounted relentless attacks against government forces. Pockmarked houses still bear the scars of these heavy gun battles. Part of the city’s main hospital, built during the British reign before 1967, was leveled by airstrikes. Wealthy residents left their ruined houses standing in the hope of receiving promised compensation from the government.
When a Saudi-led coalition began a new bombing campaign against the militants in 2015, security and vital services crumbled, opening a vacuum that enabled Al Qaeda to make another comeback. Residents said that the militants did not declare Azzan an Islamic emirate as they had in the past, instead sending operatives to the town to kidnap security personnel.
Most residents said they abhorred the militants, but a few still speak highly of the strict order they imposed and the amenities they provided. “They brought back peace and put an end to robbery and theft,” said Abdul Rahman Al Ashmali, whose relative was kidnapped by Al Qaeda in 2013. “Power and water services were available all the time.”
Qaeda militants who ruled Azzan are now hiding in the Saeed region, a rugged area in the Shabwa and Moudea districts in Abyan Province, about 50 miles west of here, said Mr. Qumishi, the Yemeni commander. “Several months ago, they pulled all of their arms and important documents from Azzan as they were predicting our arrival,” he said.