On Nov. 13, 2005, Jordanian TV showed Sajida al-Rishawi of Iraq confessing to her failed attempt to set off an explosives belt inside a hotel in Amman. The Nov. 9 attacks on three hotels killed 60 people and injured more than 100 others. (Marco Di Lauro/Getty Images)

Just after nightfall Feb. 3, a warrant arrived at the city’s main women’s prison for the execution of Sajida al-Rishawi. The instructions had come from King Abdullah II himself, then in Washington on a state visit, and were transmitted from his private plane to the royal court in Jordan’s capital.

A clerk relayed the message to the Interior Ministry and then to the prisons department, where it caused a stir. State executions are complicated affairs requiring many steps, yet the king’s wishes were explicit: The woman would face the gallows before the sun rose the next day.

The chief warden quickly made the trek to the cell where Rishawi had maintained a kind of self-imposed solitary confinement for close to a decade. The prisoner, 45 now and no longer thin, spent most of her days watching television or reading a paperback Koran, seeing no one and keeping whatever thoughts she had under the greasy, prison-issued hijab she always wore. She was not stupid, yet she seemed perpetually disconnected from whatever was going on around her. “When will I be going home?” she asked her government-appointed lawyer during rare meetings in the months after she was sentenced to death. Eventually, even those visits stopped.

Now, when the warden sat her down to explain that she would die in the morning, Rishawi nodded her assent but said nothing. If she cried or prayed or cursed, no one in the prison heard a word of it, according to Jordanian officials who described the sequence of events for a new book, “Black Flags: The Rise of ISIS.”

That she could face death was not a surprise to anyone. In 2006, a judge sentenced Rishawi to be hanged for her part in Jordan’s worst terrorist attack: three simultaneous hotel bombings that killed 60 people, most of them guests at a wedding party. She was the suicide bomber who lived, an odd, heavy-browed woman made to pose awkwardly before TV cameras showing off the vest that had failed to explode. At one time, everyone in Amman knew her story, how this 35-year-old unmarried Iraqi had agreed to wed a stranger so they could become a man-and-wife suicide team; how she panicked and ran; how she had wandered the city’s northern suburbs in a taxi, lost, stopping passersby for directions, still wearing streaks of blood on her clothes and shoes.

But nearly 10 years had passed. The hotels had been rebuilt and renamed, and Rishawi had vanished inside Jordan’s labyrinthine penal system. Within the Juwaida women’s prison, she wore a kind of faded notoriety, like a valuable museum piece that no one looks at anymore. Some of the older hands in the state security service called her “Zarqawi’s woman,” a mocking reference to the infamous Jordanian terrorist Abu Musab al-Zarqawi, who ordered the hotel bombings. The younger ones barely remembered her.

Abu Musab al-Zarqawi appears in a video released by the Mujahideen Shura Council on April 25, 2006. In the video, he is seen leading training on the battlefield and in a war room, and seated among local leaders of Iraq’s Anbar province. (Courtesy of the IntelCenter)

Then, in the span of a month, everything changed. Zarqawi’s followers, it turned out, had not forgotten Rishawi. The terrorists had rebranded themselves over the years and were now known in Jordan by the Arabic acronym Daesh — in English, as ISIS. And in early January, ISIS asked to have Rishawi back.

The demand for her release came in the middle of Jordan’s worst domestic crisis in years. A Jordanian air force jet had crashed in Syria, and its young pilot had been captured alive by ISIS fighters. The group had broadcast photos of the frightened, nearly naked pilot being paraded around by grinning jihadists, some of them reaching out to embrace this great gift that Allah had dropped from the sky.

From the palace to the security agencies, the king and his advisers steeled themselves for even more awful news. Either the pilot would be publicly butchered by ISIS, they feared, or the terrorists would demand a terrible price for his ransom.

True to form, ISIS announced its decision in macabre fashion. Less than a week after the crash, the captured pilot’s family received a call at home, from the pilot’s cellphone. On the other end, a stranger, speaking in Iraqi-accented Arabic, issued the group’s singular demand.

We want our sister Sajida, the caller said.

The same demand was repeated, along with several new ones, in a constantly shifting and mostly one-sided negotiation. All the requests were routed to the headquarters of the Mukhabarat, Jordan’s intelligence service, and all eventually landed on the desk of the imposing 47-year-old brigadier who ran the department’s counterterrorism unit. Even in an agency notorious for its toughness, Abu Haytham stood apart, a man with a burly street fighter’s physique and the personality of an anvil. He had battled ISIS in its many incarnations for years, and he had famously broken some of the group’s top operatives in interrogation. Zarqawi himself had taken several turns in Abu Haytham’s holding cell, and so had Sajida al-Rishawi, the woman ISIS was now seeking to free.

Outside Jordan, the demand made little sense. Rishawi had no value as a fighter or a leader, or even as a symbol. She was known to have participated in exactly one terrorist attack, and she had botched it. Hardly “Zarqawi’s woman,” she had never even met the man who ordered the strike. If ISIS hadn’t mentioned her name, she probably would have lived her remaining years quietly in prison, her execution indefinitely deferred for lack of any particular reason to carry it out.

But Abu Haytham understood. By invoking Rishawi’s name, the terrorists were reaching back to the group’s beginnings, back to a time before there was an ISIS, or a civil war in Syria; before the meltdown in Iraq that gave rise to the movement; even before the world had heard of a terrorist called Zarqawi. The Mukhabarat’s men had tried to keep this terrorist group from gaining a foothold. They had failed — sometimes through their own mistakes, more often because of the miscalculations of others. Now, Zarqawi’s jihadist movement had become a self-declared state, with territorial claims on two of Jordan’s borders. And Rishawi, the failed bomber, was one of many old scores that ISIS was ready to settle.

In summoning this forgotten ghost, ISIS was evoking one of the most horrifying nights in the country’s history, a moment seared into the memories of men of Abu Haytham’s generation, the former intelligence captains, investigators and deputies who had since risen to lead the Mukhabarat.

Once, Zarqawi had managed to strike directly at Jordan’s heart, and now, with the country’s pilot in their hands, ISIS was about to do it again.

The black flags will come

Abu Haytham had been present that night. It was just before 9 p.m. on Nov. 9, 2005, when the first call came in about an explosion at the Grand Hyatt across town. The early speculation was that a gas canister was to blame, but then came word of a second blast at the Days Inn, and then a third — reportedly far worse than the others — at the Radisson. He raced to the Radisson and pushed his way inside, past the rescue workers, the wailing survivors, and the recovered corpses that had been hauled out on luggage carts and deposited on the driveway. In the ballroom, through a haze of smoke and emergency lights, he could see more bodies. Some were sprawled haphazardly, as though flung by a giant. Others were missing limbs.

Just two days later came the news that one of the attackers — a woman — had survived and fled. A day after that, Sajida al-Rishawi sat in a chair in front of him.

The woman would never offer a useful syllable. “I don’t know, I don’t know,” she would occasionally manage, in a soft mumble. Yet, already, Abu Haytham knew who was behind the act.

Images from Jordanian TV show Sajida al-Rishawi, who accompanied her husband on a suicide mission in Amman and failed to detonate her explosives, displaying the belt during a televised confession Nov. 13, 2005. (Agence France-Presse via Getty Images)

Zarqawi was, at the time of the bombing, the head of a particularly vicious terrorist network called al-Qaeda in Iraq. But the Jordanians had known him back in the days when he was Ahmad the hoodlum, a high school dropout with a reputation as a heavy drinker and a brawler. They had watched him wander off to Afghanistan in the late 1980s to fight the communists, then return as a battle-hardened religious fanatic. After a first try at terrorism, he had vanished into one of Jordan’s darkest prisons. This time, he emerged as a leader of men.

Still, few would have ever heard of Zarqawi had Washington not intervened. His terrorist career was at a dead end when the George W. Bush administration inadvertently made him a terrorist superstar, declaring to the world in 2003 that this then-unknown Jordanian was the link between Iraq’s dictatorship and the plotters behind the Sept. 11, 2001, terrorist attacks. The claim was wrong, yet, weeks later, when U.S. troops invaded Iraq, the newly famous and well-funded terrorist gained a battleground and a cause and soon thousands of followers. Over three tumultuous years, he intentionally pushed Iraq to the brink of sectarian war by unleashing wave after wave of savage attacks on Shiite civilians in their mosques, bazaars and schools. He horrified millions with a new form of highly intimate terrorism: the beheading of individual hostages, captured on video and sent around the world, using the Internet’s new power to broadcast directly into people’s homes. Along the way, he helped transform America’s lightning victory in Iraq into the costliest U.S. military campaign since Vietnam. Although some would cast his movement as an al-Qaeda offshoot, Zarqawi’s brand of jihad was utterly, brutally original.

But Zarqawi’s excesses also deepened his adversaries’ resolve. In 2006, with help from Jordan, U.S. forces discovered Zarqawi’s safe house and flattened it with a 500-pound bomb. Two years later, his terrorist network appeared finished, but instead, his followers merely retreated, quietly gaining strength in Syria’s lawless provinces until they burst into view in 2013, not as a terrorist group, but as an army.

This time, war-weary America would refuse to help until it was too late. There would be no serious effort to arm the moderate rebels who sought to deny ISIS its safe haven, and no airstrikes to harry ISIS’s leadership and supply lines. Twice in a decade, a jihadist wave had threatened to engulf the region. Twice, it seemed to the Jordanians, the American response had been to cut a fresh hole in the lifeboat.

Zarqawi’s successors called themselves by different names before settling on ISIS — or simply the Islamic State. But they continued to refer to Zarqawi as the “mujahid sheik,” acknowledging the founder who had the audacity to believe he could redraw the maps of the Middle East. And, like Zarqawi, they believed their conquests would not end there.

In the prophetic passages of the Muslim holy texts known as the Hadith, Zarqawi saw his fate foretold. He and his men were the black-clad soldiers of whom the ancient scholars had written: “The black flags will come from the East, led by mighty men, with long hair and beards, their surnames taken from their home towns.” These conquerors would not merely reclaim the ancient Muslim lands. They also would be the instigators of the final cataclysmic struggle ending in the destruction of the West’s great armies, in northern Syria.

“The spark has been lit here in Iraq,” Zarqawi preached, “and its heat will continue to intensify until it burns the Crusader armies in Dabiq.”

The Mukhabarat’s men had heard enough of such talk from Zarqawi back when he was their prisoner. Now the brazen claims were coming from his offspring. Thirty thousand strong, they were waiting just across the border, calling for their sister Sajida.

‘I’m going to war’

The charade of a prisoner swap ended abruptly Feb. 3, 2015, the day after Jordan’s king arrived in Washington for the official visit.

For Abdullah II, it was the latest in a series of exhausting journeys in which he repeated the same appeal for help. His tiny country was struggling with two burdens imposed from abroad: a human tide of refugees from Syria — about 600,000 so far — and the cost of participating in the allied Western-Arab military campaign against ISIS. The trip was not going particularly well. Members of Congress offered sympathy but not much more; White House officials recited the usual pledges to bolster Jordan’s defenses and struggling economy, but the kind of assistance Abdullah most desperately needed was nowhere in the offing. During previous visits, President Obama had declined Jordan’s requests for laser-guided munitions and other advanced hardware that could take out ISIS’s trucks and tanks. On this trip, there was no firm commitment even for a meeting between the two leaders.

Abdullah was at the Capitol, making a pitch to John McCain, the Republican chairman of the Senate Armed Services Committee, when one of the king’s aides interrupted him.

The monarch stepped into the corridor, and on the small screen of a smartphone, watched ISIS deliver its final statement on the proposed prisoner swap. As video cameras rolled, masked jihadists marched the young Jordanian pilot into a small metal cage that had been doused with fuel. Then they lit a fire and filmed as the airman was burned alive.

By the time Abdullah returned to the meeting, McCain’s aide had seen the video as well. The monarch kept his composure, but ­McCain could see he was badly shaken.

“Can we do anything more for you?” McCain asked.

“I’m not getting support from your side!” Abdullah finally said. “I’m still getting only gravity bombs, and we’re not even getting resupplied with those. Meanwhile, we’re flying 200­ percent more missions than all the other coalition members combined, apart from the United States.”

The king continued with his scheduled meetings, but he had already made up his mind to return home. He was making arrangements when the White House phoned to offer 15 minutes with the president. Abdullah accepted.

President Obama meets with Jordanian King Abdullah II in the Oval Office at the White House on Feb. 3. (Mike Theiler/European Pressphoto Agency)

In the Oval Office, Obama expressed condolences to the pilot’s family and thanked the king for Jordan’s contributions to the military campaign against ISIS. The administration was doing all it could to be supportive, the president assured the monarch.

“No, sir, you are not,” Abdullah said, firmly. He rattled off a list of weapons and supplies he needed.

“I’ve got three days’ worth of bombs left,” he said, according to an official present during the exchange. “When I get home, I’m going to war, and I’m going to use every bomb I’ve got until they’re gone.”

There was one other item of business to attend to before his return. From the airport, Abdullah called his aides in Amman to start the process of carrying out a pair of executions. On Jordan’s death row, there were two inmates who had been convicted of committing murderous acts on orders from Zarqawi. One was an Iraqi man who had been a mid-level operative in Zarqawi’s Iraqi insurgency. The other was Sajida al-Rishawi. Both should be put to death without further delay.

The king foresaw that Western governments would protest the executions as acts of vengeance, even though both inmates had been sentenced long ago as part of normal court proceedings. But he would not be deterred. As far as he was concerned, the appointment with the hangman already had been delayed too long, he told aides.

“I don’t want to hear a word from anyone,” Abdullah said.

Senate Armed Services Committee Chairman John McCain (R-Ariz.) talks to reporters in Washington on Feb. 4 — one day after Jordan’s King Abdullah II met with congressional leaders — about the Senate’s consideration of whether to provide military assistance to Jordan to fight Islamic State militants. (Jim Lo Scalzo/European Pressphoto Agency)

The king was still airborne at 2 a.m. Amman time when the guards arrived to collect Rishawi from her cell. She had declined the customary final meal and ritual bath with which devout Muslims cleanse the body in preparation for the afterlife. She donned the red uniform worn exclusively by condemned prisoners on the day of execution, along with the usual hijab to cover her head and face.

She was taken outside the prison to a van with a military escort for the drive to Swaqa, Jordan’s largest prison, on a desert hill about 60 miles south of the capital. The vehicles arrived just before 4 a.m., as a full moon, visible through a light haze, was dipping toward the southwestern horizon.

Her last earthly view, before she was blindfolded, was of a small execution chamber with white walls and a row of tiny windows, and a few tired faces looking up from the witness gallery just below her.

Supporters and relatives of Lt. Muath al-Kaseasbeh, a Jordanian pilot who was burned to death by ISIS after being captured, express their anger at a tribal gathering in Amman on Feb. 3. (Raad Adayleh/Associated Press)

King Abdullah II, right, offers his condolences to the family of Lt. Muath al-Kaseasbeh, including his father, Safi al-Kaseasbeh, during a visit to their home village near Karak, Jordan, on Feb. 5. (Nasser Nasser/Associated Press)

An imam prayed as a noose with a heavy metal clasp was secured, and a judge asked if Rishawi cared to convey any last wishes or a final will. She gave no reply.

She likewise made no audible sound as the gallows’ trap opened and she plunged hard into the darkness. It was 5:05 a.m., nearly 90 minutes before sunrise, when the prison doctor checked for a pulse.

“Zarqawi’s woman” was dead, her execution the closing scene in the worst act of terrorism in Jordan’s history. But Zarqawi’s children were pursuing the founder’s far grander ambitions: the end of Jordan and its king, the erasing of international boundaries and the destruction of the modern states of the Middle East. Then, with black flags raised above Muslim capitals from the Levant to the Persian Gulf, they could begin the great apocalyptic showdown with the West.

Adapted from “Black Flags: The Rise of ISIS,” by Joby Warrick, which will be published Tuesday, Sept. 29 by Doubleday.

Read more:

The hidden hand behind the Islamic State militants? Saddam Hussein’s.

Islamic State says immolation was justified; experts on Islam say no

After Jordanian pilot’s death, king signals he will escalate fight against Islamic State