Todd Moss, former State Department official in African Affairs during the George W. Bush administration, has written a thriller about the inner workings of diplomacy and national security. (Melina Mara/The Washington Post)

As he began writing his third book on U.S.-Africa policy and development, Todd Moss, a former State Department official, realized something. It would be boring. Just another text for the shelves of foreign-policy wonks, PhDs and think tank denizens like himself.

“I decided, ‘Let me try a novel,’ ” Moss recalls. “I did it for fun. . . . I really did it with very low expectations.”

After three years, Moss, 44, birthed “The Golden Hour,” a thriller partly informed by his 18 months in the George W. Bush administration as the deputy assistant secretary of state and chief U.S. diplomat in West Africa. Moss packed his novel with episodes of bureaucratic squabbling among the CIA, the Department of Defense and various fiefs within the State Department.

Thrilled yet?

But Moss also had the good narrative sense to throw in rampaging Islamic radicals, a military coup in Mali (a vital U.S. counterterrorism ally) and a damsel in distress — specifically a U.S. senator’s daughter kidnapped from her Mali posting as a Peace Corps volunteer. The interagency intrigues actually end up heightening the stakes as the clock ticks down.

Todd Moss’s novel “The Golden Hour.” (Courtesy of G.P. Putnam's Sons)

“It is just about impossible to stop reading this book,” raved best-selling thriller writer Douglas Preston, one of the titans of the genre who blurbed the novel, which comes out Thursday.

His timing as an author was exquisite: Moss was able to get the manuscript in front of a receptive agent who read it in the spring of 2013, while following TV reports of French troops battling jihadis in northern Mali. The French went in to restore stability in their former colony after Mali’s military toppled the country’s democratic government in 2012.

The fabled city of Timbuktu also reentered the public consciousness, coming under the control of Islamist extremists who destroyed ancient shrines and libraries.

“Fiction became true,” says Moss, a modest sort who still marvels at the coincidences. “For my book I picked Timbuktu deliberately. It’s like the place everybody’s heard of, even if they don’t know where it is or if it’s real.”

Moss’s fiction debut also arrives at a propitious time for writers who plot their espionage and action stories in Africa. “Right now, books set in Africa are hot,” says Neil Nyren, editor in chief of G.P. Putnam’s Sons, and a man with a legendary reputation for cultivating thriller writers.

Besides “The Golden Hour,” Putnam’s has recently issued three other action novels set in Africa: Tom Young’s “Sand and Fire” (Libya), Matthew Palmer’s “The American Mission” (Congo), and Alex Berenson’s “The Night Ranger” (Somalia).

The hooks into the public imagination come from the headlines: Somali pirates, assorted terrorists and radical Islamists, including Boko Haram, al-Shabab and al-Qaeda in the Islamic Maghreb.

“It feels like mass chaos, which makes fertile territory for thrillers,’’ say Nyren, who is Moss’s editor.

“He’s tapping into the way we’ve gotten absolutely transfixed by the war on terrorism,” says Chester Crocker, who oversaw African diplomacy in the Reagan administration and has known Moss for a decade.

Moss put it in marketing terms: “Africa is sort of sexy now.”

More often, though, he sounds like a policy analyst, a sharp and serious one. You can imagine him briefing the nation’s topmost leaders and impressing them. But he has a welcoming, unshowy demeanor that complements his youthful looks.

We meet at the Willard Intercontinental, a favorite hotel, he notes, among African leaders. “Imagine how many shady deals were negotiated here with businessmen and lobbyists,” he muses.

But for Moss, the continent’s notorious corruption and new terrorist scourge is just one side of the story. Now, he says, Africa doesn’t want handouts, it wants private investment, and it wants be a U.S. security partner.

For nearly his entire adult life, Moss has immersed himself in the continent’s cultures, struggles and successes, beginning with a stint living with a family in Harare, Zimbabwe, as a Tufts student in 1990.

In the early ’90s, he and his future wife, Donna, spent eight months backpacking, hitchhiking and traveling by bus and train through Botswana, Zambia, Kenya, Uganda and Tanzania — including, he says, a 52-hour train journey.

Moss ultimately became a doctorate-holding expert in decidedly unsexy topics such as debt restructuring, capital markets and finance. Today, as a senior fellow and chief operating officer at the Washington-based Center for Global Development, he promotes programs to spur African economic growth.

His academic works, with such titles as “African Development: Making Sense of the Issues and Actors,” would no doubt seem impenetrable to laymen. But Moss’s colleagues in the field laud his nonfiction writing as direct and clear — and were not surprised that he pulled off an accessible novel.

‘The Golden Hour” pivots on a permutation of the lifesaving approach that aims to get a trauma victim treatment within 60 minutes. Moss learned its medical utility as an emergency medical technician and ambulance driver in Boston during college in 1989 to 1990.

The book’s hero, Judd Ryker, an official in charge of the State Department’s “crisis reaction unit,” applies the principle to diplomatic response: The faster the United States acts, the more likely a coup can be reversed, he believes. This propels the hero from his family vacation on the Outer Banks to Bamako, the capital of Mali, and eventually to Timbuktu.

Moss gained his experience in diplomatic triage during a 2008 coup in Mauritania, where he was dispatched by Secretary of State Condoleezza Rice to express the U.S. government’s severe displeasure to a military general who had overthrown the elected government. At the time, Moss called the coup by Gen. Mohamed Ould Abdel Aziz “illegal and illegitimate” and warned that the United States would pull its military support if Aziz did not step down.

But the junta leader stayed in power and later won what Moss calls a “rigged” election to become president. Last month, Abdel Aziz was sworn in for a second term in another disputed election.

Moss sees that as a classic example of the United States tolerating dictators and unreliable allies for the sake of expediency: Mauritania remains a U.S. counterterrorism partner that allows the United States to situate facilities there. Drones also fly over its territory from Burkina Faso, where the United States has established a spy-plane base.

“Anyone wonder why few people take US seriously on democracy?” Moss tweeted during the African leaders summit here this summer, over a photo of himself trying to “talk down” Aziz in 2008, juxtaposed with one of Secretary of State John F. Kerry opening the summit with the general.

“I thought it was funny,” Moss says with a small chuckle, one of few that he allows himself in the interview.

As much as the opaque, grasping nature of African players comes under examination in “The Golden Hour,” so do Washington’s jumbled agendas — “how crazy it is, the sausage machine in the U.S. government,” he says. “That interagency mess was one of the stories that I thought was interesting to people.”

You could be forgiven if you think the character who has to cut through all the lies, egos and infighting, one Judd Ryker, is based on a certain former State Department official who parachuted into the Mauritanian crisis.

“There is no character based on a real person,” the author demurs. “They are all drawn from people I know.”

But still: Just like Ryker, Moss is foreign policy scholar who found himself abruptly thrust into a top government post. Moss was offered his State job after just one meeting, and so, too, was our hero. Both are family men who fret about the job’s toll on their spouses and kids. (Moss and his wife, Donna Moss, a writer, live in Maryland with their three sons, ages 15, 13 and 9.)

He has already finished his second novel, also set in Africa, to be published next year. Judd Ryker is again the protagonist. Moss recently signed on with Putnam’s and Nyren to write two more books in the Ryker series.

Producers have expressed interest in “The Golden Hour” although no option has been sold. “I can see it really as a kind of ‘Homeland’ crossed with ‘West Wing’-type TV series,” Moss says.

Challenge to Hollywood: Make the innermost warrens of the State Department throb with excitement. Make sexy the dim hallways of the Truman Building. Sounds like another job for Judd Ryker.