TIMBUKTU, Mali — 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."

__

Associated Press writer Adam Goldman contributed to this report from Washington.

__

The letters from al-Wahashi and the case study on their occupation of southern Yemen can be viewed here:

http://hosted.ap.org/specials/interactives/_international/_pdfs/al-qaida-papers-how-to-run-a-state.pdf

Related on HuffPost:

Loading Slideshow...
  • Nasser Al-Wahishi

    Once Osama bin Laden's aide-de-camp, Wahishi is the top leader of AQAP. In February 2006, Wahishi was among 23 al-Qaeda militants who broke out of a detention facility in Sanaa, Yemen's capital. In May 2011, al-Wahishi posted a eulogy for the slain al-Qaeda leader on Islamic extremist websites in which he warned Americans "the matter will not be over" with bin Laden's death and that "what is coming is greater and worse." He said "jihad is glowing brighter" now than during bin Laden's life. Three months later, he vowed to continue the fight against the regime and Western powers. He condemned U.S. drone attacks on Yemen, which have killed civilians, and the "silence" of Yemen's leaders to these attacks. "My soldiers and those soldiers with me in the Arab gulf... will not give up nor give in until Islam is ruling by God's will and strength," al-Wahishi said. "Our war against the Zionist Crusaders remains, for they have chosen this war." <em>This file image provided by IntelCenter on Wednesday Dec. 30, 2009 and taken from a video released Jan. 23, 2009 by al-Malahim Media Foundation, the media arm of al-Qaeda in the Arabian Peninsula, shows a man IntelCenter identifies as Nasser al-Wahishi, the leader of the group. (AP Photo/IntelCenter, File)</em>

  • Qassem Al-Raimi

    Al-Raimi became the group's military commander and the brains behind a series of foiled attacks against Americans. In writings and videos, he vowed to topple Saleh's regime and to strike America. The Yemeni government has incorrectly announced al-Raimi's death three times in strikes or clashes since 2007. Even on the run, he directs training camps in Yemen's remote deserts and mountains, organizes cells and plans attacks at home and abroad, according to Yemeni officials. <em>Qassem al-Raimi, right, and Muhammed al-Dailami, left, speak to the court during the second session of the appeal to their jail sentences, San'a, Yemen, Saturday, Dec.11, 2004. (AP Photo/Muhammed Al Qadhi, courtesy the Yemen Times)</em>

  • Ibrahim Hassan Al-Asiri

    Al-Asiri is AQAP's chief bomb-maker, responsible for building the underwear bomb used to try to bring down a Detroit-bound jetliner on Christmas in 2009 and the printer-cartridge bombs intercepted in U.S.-bound cargo planes a year later. U.S. intelligence officials say he has resurfaced recently in Yemen, after months in hiding. <em>This undated file photo released by Saudi Arabia's Ministry of Interior on Sunday, Oct. 31, 2010, purports to show Ibrahim Hassan al-Asiri. (AP Photo/Saudi Arabia Ministry of Interior, File)</em>

  • Anwar Al-Awlaki

    The 40-year-old American-Yemeni cleric emerged as an enormously influential preacher among militants living in the West, with his English language Internet sermons calling for jihad, or holy war, against the United States. He was in contact with the accused perpetrators of the 2009 shooting rampage at Fort Hood, Texas, that killed 13 people, the 2010 car bomb attempt in New York's Times Square and the Christmas 2009 attempt to blow up an airliner heading to Detroit. Al-Awlaki was killed on Sept. 30, 2011 in a drone strike in the mountains of Yemen. <em>In this Nov. 8, 2010 file image taken from video and released by SITE Intelligence Group on Monday, Anwar al-Awlaki speaks in a video message posted on radical websites. (AP Photo/SITE Intelligence Group, File)</em>

  • Abdulhakim Muhammad

    Muhammad, 28, is serving a life prison sentence for the June 2009 fatal shooting of a soldier outside a Little Rock, Ark., military recruiting station. Muhammad, who changed his name from Carlos Bledsoe when he converted to Islam, grew up in the Memphis, Tenn., area and then traveled to Yemen, returning to the U.S. in 2008. Muhammad has described himself as a soldier in al-Qaeda in the Arabian Peninsula and called the shooting "a jihadi attack." <em>In this July 7, 2010 file photo, Abdulhakim Muhammad is escorted to a hearing at the Pulaski County Court House in Little Rock, Ark. An Arkansas Department of Correction spokeswoman said Friday, Oct. 19, 2012, that corrections officers found a piece of metal in Muhammad's mattress during a routine search in April. (AP Photo/Danny Johnston, File)</em>

  • Major Nidal Hasan

    Hasan, 42, a U.S.-born Army psychiatrist of Palestinian descent, is accused in the 2009 shooting rampage that killed 13 people at the Army post in Fort Hood, Texas. The Hasan case prompted a slew of finger-pointing among government agencies over why more action wasn't taken when red flags appeared, particularly his e-mail contact with a radical cleric in Yemen. <em>This undated file photo provided by the Bell County Sheriff's Department shows Nidal Hasan, who is charged in the 2009 shooting rampage at Fort Hood that left 13 dead and more than 30 others wounded. (AP Photo/Bell County Sheriff's Department, File)</em>

  • Sharif Mobley

    Sharif Mobley, 29, a New Jersey man of Somali descent is imprisoned in Yemen, suspected of ties to al-Qaeda and killing a guard in a failed escape attempt. During his time in the United States, Mobley passed a criminal background check and worked as a laborer at a number of nuclear power plants. There is no indication that his work had any connection to his alleged involvement with terrorists. A former friend said Mobley became increasingly radicalized in his Muslim beliefs before he moved to Yemen. <em>This 2002 photo provided by Roman Castro shows Sharif Mobley, 26, at a barbecue in Buena, N.J. (AP Photo/Roman Castro, File)</em>