Libya must not become “a safe haven for terrorists” after the apparent beheadings of 21 Egyptian Christians in the country, the prime minister said.
David Cameron condemned the “barbaric” killings after militant group Islamic State posted a video online.
He said the UK must remain “steadfast” in efforts to defeat IS and bring a political transition in Libya through the UN.
The Archbishop of Canterbury described the killings as a “terrible cruelty”.
Mr Cameron said: “I am appalled by the murder of Christians in Libya, a simply barbaric and inhumane act.
“My thoughts are with the families of those killed and the UK stands united with the Egyptian people during this period of mourning.
“Our efforts to defeat the monstrosity of Islamist extremism must not waver.”
Mr Cameron’s comments came as security sources said Egypt had launched a second wave of air strikes on positions held by IS.
The strikes followed the emergence of a video on Sunday showing the 21 Coptic Christians, who were captured in December and January from the eastern coastal town of Sirte, in Libya, being forced to the ground before they are beheaded.
In a statement the Archbishop of Canterbury, Justin Welby, the principal leader of the Church of England, also commented on the recent shootings in Denmark and a suicide bombing in Nigeria.
“The killers seem to rejoice in ever more extreme acts carried out to inflict greater terror,” he said.
The archbishop said he was praying “for governments affected to be wise and courageous.”
The UK government said the beheadings only increased its determination to counter the terrorist threat.
Foreign Secretary Philip Hammond said acts of terrorism should not “undermine” Libya’s political transition.
He said: “We remain fully supportive of the UN’s efforts to build a national unity government for Libya and to bring a political solution to the ongoing security crisis.
“Those who support terrorists can have no part in this process.”
Michael Nazir-Ali, a Pakistani-born British Anglican bishop and former Bishop of Rochester, said there needed to be “restoration of order” in the country, which “cannot wait for a political solution”.
He told BBC Radio 4’s World at One programme: “If, under UN auspices, there is some authorisation for a force to restore order in Libya, that would be welcome by all sorts of people.
“That does involve, I’m sorry to say, ground forces.”
Bishop Nazir-Ali went on to say the international community was no longer dealing with “angels and monsters”.
He said: “We are dealing with a situation where we have to ask, ‘Who is the lesser monster?’
“Take Syria, for instance. President Assad is no saint but compared to what IS is doing, we have to ask should we deal with this man to get rid of this much greater evil?”
The leader of the Coptic Orthodox Church in the UK said the brutality was “plunging the world back into a medieval time”.
He said: “There is a sanctity and a value to human life that I think is intrinsic to all of us as human beings, so how someone can be part of that is horrifying.
“We are being plunged back into a medieval time that we left centuries ago.”
Mr Cameron is to discuss action against Islamist extremists with the Sultan of Brunei during talks on Monday at his country residence, Chequers.