The deadliest terror attack in Africa’s history began with a loaded truck barreling down a busy street in Somalia’s capital, seemingly bound for the international airport and the embassies sheltering there.

The truck instead detonated in Mogadishu traffic, killing well over 500 people. Horrified Somalis, in a rare protest, marched by the thousands to defy the Islamic extremist group that’s now the deadliest in sub-Saharan Africa, the al-Qaida-linked al-Shabab.

On Sunday [Oct. 14], Somalia marks the year anniversary of the bombing, one of the worst terror attacks since 9/11.

Anyone with interest in the spread of extremism should read the new book “Inside al-Shabaab: The Secret History of al-Qaeda’s Most Powerful Ally” (Indiana University Press, $70).

The authors, Voice of America journalists Harun Maruf and Dan Joseph, interviewed al-Shabab members, defectors and others to describe how an Islamic nation once known for moderation slid into the hands of young men trained in Osama bin Laden’s camps abroad.

“This was the start of the battle between al-Qaeda and America,” one al-Shabab leader said of the battle for Mogadishu in the early 1990s, as bin Laden-backed fighters attacked U.S. troops who tried to restore order after the fall of dictator Siad Barre. The “Black Hawk Down” attack in 1993 that saw U.S. soldiers dragged through the streets led the U.S. military to leave Somalia alone for two decades.

Inspired, a new generation of Islamic fighters — al-Shabab is Arabic for “the youth” — took shape.

Widespread corruption, deeply held clan rivalries, exasperation from Western and African allies all have affected the fight against al-Shabab. Now, the country, with a Somali-American president who spent years as a bureaucrat in Buffalo, New York, faces the prospect of taking over its own security from the A.U. force in a few years.

The U.S. military, which under President Donald Trump has increased drone strikes in Somalia and put about 500 personnel on the ground, has warned that Somali forces aren’t ready.

And now a new threat has emerged: “Inside al-Shabaab” devotes a chapter to the rise of fighters who have pledged allegiance to the Islamic State organization.