Hammami wouldn’t say where he was, but he urged Dena not to worry about him. He was prepared to meet death, he said. “I don’t do anything too dangerous except once every month or so,” he added. “It’s all in God’s hands.”

Hammami’s life in Somalia appears to be more precarious than he let on. He spends much of his time shuttling between villages in southern Somalia, where many of the Shabab’s camps are based, according to Somali intelligence officials. In addition to his role as a military tactician, they said, Hammami helps guide the Shabab’s recruitment strategy and management of money — exercising surprising power after landing in Somalia as a 22-year-old rookie. The Somali government is seeking increased American aid to fight the Shabab and may have reason to play up the threat of foreigners like Hammami. But they were adamant about his role. “This guy is dangerous,” says Abdullahi Mohamed Ali, the Somali minister of national security. “He’s a threat to the region. I want him to be eliminated.”

When Hammami engages in combat, he makes an impression on other militants, said a former Shabab commander, Sheikh Mohamed Sheikh Abdullahi Sheikh Mohamed. “He doesn’t blink in the face of the enemy,” said Mohamed, who recalled four battles in 2008 and 2009 in which he and Hammami took part. In combat, Hammami used a sharpshooter’s rifle, firing calmly and with precision, said Mohamed, who spoke to me by telephone this month from a government compound in Mogadishu after defecting to the government’s side. Somali officials said they were keeping him there for his protection.

Until recently, the few visible images of American jihadis were of young men on the margins: John Walker Lindh, a Californian loner who wandered into Afghanistan to join the Taliban; or Adam Gadahn, now a Qaeda spokesman, who grew up home-schooled on a goat farm and channeled his teenage energies into death-metal music. If Omar Hammami followed his own compass, others followed him. Years later, more than one of his classmates compared him to the incongruous high-school hero of the 1986 film “Ferris Bueller’s Day Off.”

Hammami’s journey from a Bible Belt town in America to terrorist training camps in Somalia was pieced together from interviews with his parents, sister, best friends and law-enforcement officials, as well as hours of home videos and passages from his e-mail messages, journal entries and hundreds of his postings on an Internet forum. If anything has remained a constant in Hammami’s life, it is his striving for another place and purpose, which flickered in a poem he wrote when he was 12:

“My reality is a bore. I wish, I want, I need the wall to fall and the monster to let me pass, the leash to snap, the chains to break. . . .

“I’ve got a taste of glory, the ticket, but where is my train?”

DAPHNE SITS ALONG Alabama’s serene Mobile Bay, just north of the Gulf of Mexico. The town seems stopped in time. Colonial-style cottages and gazebos dot the bluffs. The wide, blacktopped streets are shaded by pecan trees and Southern maples. At dusk, the tide slaps the docks as fishermen loll, casting silhouettes against a golden sky.

Shafik Hammami was searching for a quiet American town when he left Syria in 1972. He was reared in Damascus, the oldest of nine children whose father ran an import-export business. Shafik wanted to study medicine and heard that small colleges in less-populated parts of the United States were best suited for immigrants, “so you don’t get lost in the shuffle,” he told me recently. By chance, a translator working in Damascus handed him a brochure for Faulkner State Community College in Bay Minette, not far from Daphne. He looked no farther.