How Islamic State came to be the West’s No. 1 terrorist threat and how the United States should respond will surely be debated during the presidential campaign the next two months, as Donald Trump showed recently by declaring Barack Obama and Hillary Clinton the group’s founders.

Trump would be wise to read Joby Warrick’s “Black Flags: The Rise of ISIS” to get the true story.

The winner of the Pulitzer Prize for nonfiction, now out in paperback with an afterword addressing last November’s attack on Paris, “Black Flags” explores how the group’s true founder, Abu Musab al-Zarqawi, and his current successor, Abu Bakr al-Baghdadi, built an Islamist army that helped shatter Iraq and Syria.

Islamic State’s rise was not inevitable. But now its adherents are spread throughout Europe and North America with the potential to repeat Paris-type attacks over and over and turn more people in the West against Islam in general, feeding Baghdadi’s apocalyptic dreams.

President George W. Bush and those in his administration who were determined to invade Iraq in 2003 without a workable plan for making that country a shining light of Arab democracy created the chaos Zarqawi fed on, then made him an Islamist hero in an effort to show a link between Saddam Hussein and Osama bin Laden.

President Obama and his administration, in their rush to exit Iraq and their determination to avoid being sucked into Syria, gave the remnants of the organization created by Zarqawi the time, space and conditions to re-form, strengthen and expand under Baghdadi.

Warrick did find heroes who recognized the threat and offered wise counsel on how to respond, from Jordanian King Abdullah II to Gen. Stanley McChrystal to CIA analyst Nada Bakos to Ambassador Robert Ford.

Warrick’s extensive reporting and thorough narrative are much stronger regarding the first phase of what is now Islamic State under Zarqawi, who died in 2006, but the bipartisan and multinational mistakes and missed opportunities over two decades provide ample lessons for would-be American policymakers.

Black Flags: The Rise of ISIS

By Joby Warrick

Anchor Books, 374 pages, $16


What: Prologue to the Book Festival event

Where: Marcus JCC, 5342 Tilly Mill Road, Dunwoody

When: 7:30 p.m. Tuesday, Sept. 13

Tickets: $10 for JCC members, $15 for others; www.showclix.com/event/jobywarrick/listing