AMMAN, Jordan — Jordan executed two al-Qaeda 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.

A security source said the executions were carried out at Swaqa prison south of the capital Amman in the presence of an Islamic legal official.

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

This combination of two photographs shows the detail of a poster of an undated photograph of Jordanian pilot Lt. Muath al-Kaseasbeh, left, used during a demonstration calling for his release from the Islamic State group, and a still image from video, right, of Sajida al-Rishawi, an Iraqi woman sentenced to death in Jordan for her involvement in a 2005 terrorist attack on a hotel that killed 60 people. (photo credit: AP Photo)

This combination of two photographs shows the detail of a poster of an undated photograph of Jordanian pilot Lt. Muath al-Kaseasbeh, left, used during a demonstration calling for his release from the Islamic State group, and a still image from video, right, of Sajida al-Rishawi, an Iraqi woman sentenced to death in Jordan for her involvement in a 2005 terrorist attack on a hotel that killed 60 people. (photo credit: AP Photo)

Rishawi had been sentenced to death after her 2005 role in a triple hotel bombing in Amman that killed 60 people. Karbouly was sent to death row in 2008 for plotting terror attacks on Jordanians in Iraq.

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

Jordan had on Tuesday vowed an “earth-shattering” response to the killing of Kasasbeh, hours after a harrowing video emerged online purporting to show the captive and caged 26-year-old F-16 fighter pilot engulfed in flames.

Kasasbeh 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.

After word spread that the pilot had been killed, dozens of people chanting slogans against the Islamic State group marched toward the royal palace to express their anger. Waving a Jordanian flag, they chanted, “Damn you, Daesh!” — using the Arabic acronym of the group — and “We will avenge, we will avenge our son’s blood.”

Protesters marched in the pilot’s home village of Ai and set a local government office on fire. Witnesses said the atmosphere was tense and that riot police patrolled the streets.

Kasasbeh 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-Islamic State group alliance.

The killing of the pilot appeared aimed at pressuring the government of Jordan — a close US 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.

Moaz Kasasbeh seen in a video released by the Islamic State on February 3, 2015. (Screen capture: via YouTube)

Moaz Kasasbeh seen in a video released by the Islamic State on February 3, 2015. (Screen capture: via YouTube)

Jordan’s King Abdullah II, who was visiting Washington as the video came to light, described Kasasbeh as a hero and vowed to take the battle to IS in a televised address to his shocked and outraged nation.

The army and government vowed to avenge the pilot’s murder, with Momani saying: “Jordan’s response will be earth-shattering.

“Whoever doubted the unity of the Jordanian people, we will prove them wrong,” he said.

US President Barack Obama, who hosted Abdullah in a hastily organized Oval Office meeting, led international condemnation of the murder, decrying the “cowardice and depravity” of IS.

“The president and King Abdullah reaffirmed that the vile murder of this brave Jordanian will only serve to steel the international community’s resolve to destroy ISIL,” a National Security Council spokesman said after the pair met, using an alternative name for IS.

President Barack Obama, right, meets with King Abdullah II of Jordan in the Oval Office of the White House, on Tuesday, Feb. 3, 2015, in Washington. (photo credit: AP/Evan Vucci)

President Barack Obama, right, meets with King Abdullah II of Jordan in the Oval Office of the White House, on Tuesday, Feb. 3, 2015, in Washington. (photo credit: AP/Evan Vucci)

The Obama administration had earlier reaffirmed its intention to give Jordan $3 billion in security aid over the next three years.

Kasasbeh was captured in December when his jet crashed over northern Syria on a mission that was part of the coalition air campaign against the jihadists.

Jordanian state television suggested he was killed on January 3, before IS offered to spare his life and free Japanese journalist Kenji Goto in return for Rishawi’s release.

British Prime Minister David Cameron called the murder “sickening” while UN chief Ban Ki-moon labelled it an “appalling act”.

Japan’s Prime Minister Shinzo Abe condemned it as “unforgivable”.

The highly choreographed 22-minute video shows Kasasbeh at a table recounting coalition operations against IS, with flags from the various Western and Arab countries in the alliance projected in the background.

It then shows Kasasbeh dressed in an orange jumpsuit and surrounded by armed and masked IS fighters in camouflage.

This still image made from video released by Islamic State group militants and posted on the website of the SITE Intelligence Group on Tuesday, Feb. 3, 2015, purportedly shows Jordanian pilot Lt. Muath al-Kaseasbeh standing in a cage just before being burned to death by his captors. The death of the 26-year-old pilot, who fell into the hands of the militants in December when his Jordanian F-16 crashed near Raqqa, Syria, followed a weeklong drama over a possible prisoner exchange. (photo credit: AP Photo/SITE Intelligence Group)

This still image made from video released by Islamic State group militants and posted on the website of the SITE Intelligence Group on Tuesday, Feb. 3, 2015, purportedly shows Jordanian pilot Lt. Muath al-Kaseasbeh standing in a cage just before being burned to death by his captors. The death of the 26-year-old pilot, who fell into the hands of the militants in December when his Jordanian F-16 crashed near Raqqa, Syria, followed a weeklong drama over a possible prisoner exchange. (photo credit: AP Photo/SITE Intelligence Group)

It cuts to him standing inside a cage and apparently soaked in petrol before a masked jihadist uses a torch to light a trail of flame that runs to the cage and burns him alive.

The video also offered rewards for the killing of other “crusader” pilots.

IS had previously beheaded two US journalists, an American aid worker and two British aid workers in similar highly choreographed videos.

Shiraz Maher, from the International Center for the Study of Radicalization at King’s College London, described the footage as “simply the most horrific, disgusting thing I have seen from Islamic State in the last two years”.

“They clearly want to make a real point. This is the first individual whom they have captured who has been directly involved with the Western coalition in fighting IS. It is different from the aid workers… This is an act of belligerence.

“Every time you think they cannot commit anything worse — they open up another trapdoor.”

The Islamic State group last year declared an Islamic “caliphate” as it rampaged across Iraq and Syria in a brutal offensive of executions and forced religious conversions.

Kasasbeh’s plane was the first loss of an aircraft since the US-led coalition launched strikes against IS last year.

US Central Command said that the group still had the ability “to conduct small-scale operations” despite months of air strikes.

But, it said, “their capacity to do so is degraded and their momentum is stalling.”