TIMBUKTU, Mali (AP) — A year before he was caught on an intercept discussing the terror plot that prompted this week’s sweeping closure of U.S. embassies abroad, al-Qaida’s top operative in Yemen laid out his blueprint for how to wage jihad in letters sent to a fellow terrorist.

In what reads like a lesson plan, Nasser al-Wahishi provides a step-by-step assessment of what worked and what didn’t in Yemen. But in the never-before-seen correspondence, the man at the center of the latest terror threat barely mentions the extremist methods that have transformed his organization into al-Qaida’s most dangerous branch.

Instead, he urges his counterpart in Africa whose fighters had recently seized northern Mali to make sure the people in the areas they control have electricity and running water. He also offers tips for making garbage collection more efficient.

“Try to win them over through the conveniences of life,” he writes. “It will make them sympathize with us and make them feel that their fate is tied to ours.”

The perhaps surprising hearts-and-minds approach advocated by the 30-something Wahishi, who spent years as Osama bin Laden’s personal secretary, is a sign of a broader shift within al-Qaida. After its failure in Iraq, say experts who were shown the correspondence, the terror network realized that it is not enough to win territory: They must also learn to govern it if they hope to hold it.

“People in the West view al-Qaida as only a terrorist organization, and it certainly is that … but the group itself is much broader, and it is doing much more,” says Gregory Johnsen, a scholar at Princeton University whose book, “The Last Refuge,” charts the rise of al-Qaida in Yemen. “The group sees itself as an organization that can be a government.”

The correspondence from al-Wahishi to Algerian national Abdelmalek Droukdel is part of a cache of documents found earlier this year by the AP in buildings in Timbuktu, which until January were occupied by al-Qaida’s North African branch. The letters are dated May 21 and Aug. 6, 2012, soon after al-Wahishi’s army in Yemen was forced to retreat from the territory it had seized amid an uprising against long-time Yemeni ruler Ali Abdullah Saleh.

At the time, the terror network as a whole was trying to come to grips with its losses in Iraq, where people rose up against the brutal punishments meted out by al-Qaida’s local affiliate, a revolt which allowed U.S. forces to regain the territory they had occupied. That failure which was front and center in how al-Qaida in the Arabian Peninsula went about governing the two provinces it held for 16 months on Yemen’s southern coast, including the region where al-Wahishi was born, says Robin Simcox, research fellow at the Henry Jackson Society, author of a study chronicling the group’s attempt at governance.

In the May letter, al-Wahishi warns his counterpart not to crack down too quickly or too harshly.

“You have to be kind,” he writes. “You can’t beat people for drinking alcohol when they don’t even know the basics of how to pray. … Try to avoid enforcing Islamic punishments as much as possible, unless you are forced to do so. … We used this approach with the people and came away with good results.”

Al-Qaida’s foray into governance in Yemen began on the morning of Feb. 28, 2011, when residents of the locality of Jaar woke up to find an ominous black flag flying over their town. Fearing the worst, the population was mystified to discover that their extremist occupiers appeared more interested in public works projects, than in waging war.

“There were around 200 of them. They were wearing Afghan clothes, black robes that go to the knees, with a belt,” said Nabil Al-Amoudi, a lawyer from Jaar. “They started extending water mains. … They installed their own pipes. They succeeded in bringing electricity to areas that had not had power before.”

Al-Qaida in the Arabian Peninsula chronicled their achievements in 22 issues of an online newsletter and in propaganda films showing glowing light bulbs and whirring fans inside the homes of villagers who had never had power before. In one video, al-Qaida fighters are seen leaning ladders against power poles and triumphantly yelling “Allah Akbar,” or “God is great,” each time they connect a downed wire. They took time to write a detailed report, a kind of al-Qaida ‘case study’ on their occupation, which al-Wahashi dutifully enclosed with his letter, like a college professor giving a handout to a student.

They were pushed out in June of 2012, just as al-Qaida’s affiliate in North Africa succeeded in grabbing an Afghanistan-sized chunk of northern Mali, giving the terror network another chance to try their hand at governing. Adopting an avuncular, almost professorial tone, al-Wahishi, whose close relationship with Osama bin Laden allows him to speak with the authority of someone who studied at the knees of the master, advises Droukdel to publicize his good deeds. He advises them to do frequent PR, courting the media to change people’s perception of the terror brand.

“The world is waiting to see what you do next and how you go about managing the affairs of your state,” he writes. “Your enemies want to see you fail and they’re throwing up obstacles to prove to people that the mujahedeen are people that are only good for fighting and war, and have nothing to do with running countries.”

This preoccupation with al-Qaida’s image is clear throughout the letters. The former U.S. ambassador to Yemen, Stephen Seche, says the letters from al-Wahishi are in large part about the group’s perception of itself.

“These guys are no longer in the business of just trying to take out Western targets. They are in the business of establishing themselves as legit alternatives to governments that are not present in areas on a daily business,” says Seche, who served between 2007 and 2010. “I don’t think we should be fooled by this. …This is a velvet glove approach. It will come off.”

For many in Yemen, the glove came off on Feb. 11, 2012, when a man accused of spying was arrested and sentenced to death by crucifixion. No amount of time or gradual application of Shariah could have prepared the population for what came next.

His body was left to rot, hanging from a power pole, a scene captured in a YouTube video, says Katherine Zimmerman, senior analyst at the American Enterprise Institute’s Critical Threats Project, who identifies the incident as the turning point in public opinion.

Al-Wahishi does not acknowledge losing the support of the population, though he concedes his men were forced to retreat, as Yemen’s army, backed by the U.S. military, regained control of the south. He explains that they pulled out after concluding that resisting would have both drained their resources, and caused high civilian casualties.

Al-Wahishi is blunt in laying out the cost of al-Qaida’s foray — and how it was financed.

“The control of these areas during one year cost us 500 martyrs, 700 wounded, 10 cases of hand or leg amputation and nearly $20 million,” he writes. “Most of the battle costs, if not all, were paid for through the spoils. Almost half the spoils came from hostages. Kidnapping hostages is an easy spoil, which I may describe as a profitable trade and a precious treasure.”

In conclusion, al-Wahishi warns Droukdel not to be drawn into a prolonged war. He effectively recommends the strategy al-Qaida used in both Yemen and Mali: Melt into the background while preparing to strike again: “Hold on to your previous bases in the mountains, forests and deserts and prepare other refuges for the worst-case scenario,” he says. “This is what we came to realize after our withdrawal.”

A tiny man with a pointy beard, al-Wahishi spent years serving as Osama bin Laden’s personal assistant, handling his day-to-day affairs before returning to his native Yemen, where he became emir of al-Qaida in the Arabian Peninsula in 2002. In 2009, the group attempted to send a suicide bomber with explosives sewn into his underwear onto a Detroit-bound flight. Recently, U.S. officials recently intercepted a communication between al-Wahishi and al-Qaida supreme chief Ayman al-Zawahri, causing the U.S. to shutter 19 embassies and consulates.

Although al-Qaida has been on a learning curve since Iraq, it still does not seem to understand how to govern populations used to a far more moderate form of Islam. Al-Qaida experts say this extremism is a permanent Achilles’ heel for the terror franchise — their final destination jars, regardless of how slowly they drive to get there.

“The question is, are these groups always fated to overplay their hand?” asks Simcox. “They are so ideological, that they will always veer in this direction.”