Egyptian President Abdel Fattah al-Sisi warned on Sunday night that his country would respond to the beheadings of 21 Egyptian Christians in Libya by the Islamic State (ISIS).

Earlier, ISIS released a video purportedly showing the beheading of the Coptic Christians it had captured in the Libyan capital Tripoli.

The footage released online shows handcuffed hostages wearing orange jumpsuits being beheaded by their black-suited captors.

Speaking on national television hours after the release of the video, Sisi said Cairo would choose the "necessary means and timing to avenge the criminal killings", Reuters reported.

Sisi, who met with the country's top military commanders to discuss the killings, called for a seven-day mourning period.

Egypt's state news agency MENA quoted the spokesman for the Coptic Church as confirming that the 21 Egyptian Christians believed to be held by ISIS were dead.

The Coptic Church also said it was confident the government would seek justice, according to Reuters.

Libya is home to a large community of both Muslim and Coptic Egyptians, with most working in the construction sector.

The country has been plagued by instability and infighting since the toppling of Muammar Qaddafi in 2011, and independent militias still control large part of Libya and regularly fight each other. Terrorist groups have taken advantage of the situation and are training fighters on Libyan soil.

Egypt evacuated its embassy in Tripoli and consulate in Benghazi last year after kidnappers seized Egypt’s cultural attaché and three other embassy diplomats.

Egypt has been fighting ISIS terrorism on its own soil, as the ISIS-affiliated Ansar Bayt Al-Maqdis has been carrying out scores of terrorist attacks in the restive Sinai Peninsula.

Among the attacks claimed by the group since the ouster of former Islamist President Mohammed Morsi was the assassination of a top Egyptian police general, who was gunned down as he left his home in a west Cairo neighborhood, and a bus bombing on a tour bus filled with South Korean tourists in the Sinai. 

Most recently, the group claimed responsibility for coordinated attacks that killed more than 30 members of the security forces in late January.