Jordan executed two al-Qaida prisoners before dawn Wednesday, a government spokesman said, just hours after Islamic State militants released a video purportedly showing a captured Jordanian pilot being burned alive in a cage.

Jordan confirmed the pilot’s death and vowed a swift and lethal response.

Government spokesman Mohammed al-Momani identified the two prisoners executed by hanging early Wednesday as Sajida al-Rishawi and Ziad al-Karbouly.

Over the past week, Jordan had offered to trade al-Rishawi, a failed suicide bomber, for the pilot, Lt. Muath al-Kaseasbeh, but froze any swap after saying it had received no proof that the pilot was still alive.

Al-Rishawi had been sentenced to death after her 2005 role in a triple hotel bombing in Amman that killed 60 people. Her suicide belt did not detonate at the time and she fled the scene, but was quickly arrested. After a televised confession, she recanted, but her appeal was turned down.

Al-Rishawi has family ties to the Iraqi branch of al-Qaida, a precursor of the Islamic State group.

The killing of the pilot outraged Jordanians and drew worldwide condemnation, including from President Barack Obama and the U.N. Security Council.

Al-Kaseasbeh had fallen into the hands of the militants in December when his F-16 crashed near Raqqa, Syria, the de facto capital of the Islamic State group’s self-styled caliphate. He is the only coalition pilot to be captured to date.

The killing of the 26-year-old pilot appeared aimed at pressuring the government of Jordan — a close U.S. ally — to leave the coalition that has carried out months of airstrikes targeting Islamic State positions in Syria and Iraq. But the extremists’ brutality against a fellow Muslim could backfire and galvanize other Sunni Muslims in the region against them.

King Abdullah II, who has portrayed the campaign against the extremists as a battle over values, was in Washington on a previously scheduled trip. He added a stop at the White House with President Barack Obama.

The monarch broadcast a speech on Jordanian TV on Tuesday evening, confirming the pilot’s death “with sorrow and anger,” and urging his countrymen to unite.

“It’s the duty of all of us to stand united and show the real values of Jordanians in the face of these hardships,” Abdullah said. The official Petra news agency said he would be cutting short his Washington trip.

Obama said the Islamic State group’s video, if authentic, showed “the viciousness and barbarity of this organization.”

“And it, I think, will redouble the vigilance and determination on the part of a global coalition to make sure that they are degraded and ultimately defeated,” he told reporters during an event at the White House.

Obama later issued a statement offering condolences, saying the pilot’s “dedication, courage, and service to his country and family represent universal human values that stand in opposition to the cowardice and depravity of ISIL, which has been so broadly rejected around the globe.” The Islamic State group is known variously by the acronyms ISIL, ISIS and, in Arabic, Daesh.

Dozens of people chanting slogans against the Islamic State marched toward the royal palace to express their anger. Waving a Jordanian flag, they chanted, “Damn you, Daesh!” and “We will avenge, we will avenge our son’s blood.”

“Our punishment and revenge will be as huge as the loss of the Jordanians,” said the spokesman of the armed forces, Mamdouh al-Ameri.

The 20-minute video purportedly showing the pilot’s killing was released on militant websites and bore the logo of the extremist group’s al-Furqan media service. The clip featured the slick production and graphics used in previous Islamic State videos.

The pilot showed signs of having been beaten, including a black eye. Toward the end of the video, he was shown wearing an orange jumpsuit. He stood in an outdoor cage as a masked militant ignited a line of fuel leading to it.

The video, which could not immediately be confirmed independently by The Associated Press, threatened other purported Jordanian pilots by name.

It emerged three days after Japanese journalist Kenji Goto was purportedly beheaded by the militants. The fate of the journalist and the pilot had been linked by their captors.

Al-Kaseasbeh is from a tribal area in southern Jordan’s Karak district. The tribes are considered a mainstay of support for the monarchy, but the pilot’s capture has strained that relationship. Members of the pilot’s family have repeatedly accused the government of botching efforts to win his release and have also criticized Jordan’s participation in the anti-IS alliance.

The pilot’s father, Safi Yousef al-Kaseasbeh, was attending a tribal meeting in Amman when news of the video surfaced, and he was seen being led from the session. Other men were seen outside, overcome with emotion.

Late on Tuesday, as word spread of his death, protesters marched in his home village of Ai and set a local government office on fire. Witnesses said the atmosphere was tense and that riot police were patrolling the streets.

In Amman, family members gathering at a tribal meeting place wept when receiving word of his death. Outside, hundreds of protesters took to the streets, chanting: “There is no god but God and the martyr is beloved by God.”

The Islamic State group, which controls around a third of Syria and neighboring Iraq, has released a series of gruesome videos showing the killing of captives, including two American journalists, an American aid worker and two British aid workers. Tuesday’s was the first to show a captive being burned alive.

The U.N. Security Council in a press statement condemned the “brutality of ISIL, which is responsible for thousands of crimes and abuses against people from all faiths, ethnicities and nationalities, and without regard to any basic value of humanity.”

David L. Phillips, a former State Department adviser on the Middle East, said he believes the pilot’s killing could backfire, antagonizing Sunnis against the extremists, including Sunni tribes in Iraq.

“They need to have a welcome from Sunni Arabs in Anbar Province (in Iraq) to maintain their operations,” said Phillips, director of the Program on Peace-building and Human Rights at Columbia University.

He said the extremist group’s recent military setbacks may have fueled the killings. “They need to compensate for that with increasingly gruesome killings of prisoners,” he said.

Jordan has made clear that the hostage crisis will not prompt it to leave the coalition.

“We now all know in Jordan, beyond any doubt, how barbaric ISIS is,” said Mohammed al-Momani, a government spokesman. “Whoever doubted the unity of Jordan will now be proved wrong. Whoever doubts Jordan’s stern and lethal response will be proved wrong.”

Experts are divided over whether Jordan faces a greater threat from extremists outside its borders or from those within. In recent months, there have been signs of greater support for the Islamic State group’s ideas among Jordan’s young and poor. Last year, the government intensified a crackdown on IS sympathizers and the al-Qaida branch in Syria.

Laub reported from Jerusalem. Associated Press writers Mohammed Daraghmeh in Ramallah, West Bank, Bassem Mroue in Beirut, Joseph Krauss in Cairo, Cara Anna at the United Nations, and Donna Cassata in Washington contributed to this report.