Major Chirchir fired back, “Life has better to offer than stonning innocent girl,” a reference to the Shabab’s penchant for harsh Islamic punishments like stoning.

The Shabab have teased Major Chirchir for his spelling mistakes and have tossed around some SAT-quality words.

“Stop prevaricating & say what you really think, Major!” the Shabab wrote. “Sure your comments will invite derision but try to muster (or feign) courage at least.”

Few Somalia hands are surprised by all this. The Shabab may be bloodthirsty, and in the areas they control — and they still control many — they have yanked out gold teeth, beheaded shopkeepers, sawed off arms and stoned adulterers. Yet, at the same time, they have shown their technical skills, making powerful suicide bombs and roadside explosives. They also have a geeky side, showcasing their work through slick propaganda videos, Web sites and digital chat rooms.

Beyond that — and quite frightening to many American officials — is the fact that educated Westerners are clearly working for the Shabab. Several Somali-Americans have killed themselves as suicide bombers, and even non-Somali Westerners, including one man from Alabama, are serving as battlefield commanders.

Of course, it is impossible to know who exactly is operating the Twitter account, HSMPress, which refers to the Harakat al-Shabab al-Mujahedeen, or Movement of Holy Warrior Youth, the Shabab’s full name. But African Union and Western officials have said the account is legitimate, and HSMPress recently used Twitter to publish the identification cards of several missing African Union peacekeepers, presumably killed in battle. On Wednesday, the African Union confirmed that the cards were authentic.

The Twitter account is linked to an e-mail account operated by the Shabab “Press Office” that routinely provides detailed — though slanted — information about the continuing combat between the Shabab and the African Union peacekeepers. Sometimes, the Shabab’s information is more truthful than the African Union’s, as was the case during an intense recent battle in Somalia’s capital, Mogadishu, in which the Shabab claimed to have killed scores of peacekeepers, while the African Union initially said it had lost only 10. African Union officials later conceded that the Shabab had been correct.