London: The UK's security and intelligence agencies are examining a grisly Islamic State video to identify a man and young boy with British accents, threatening Prime Minister David Cameron that the terror group will one day "invade" Britain and "rule by the Sharia".

The 10-minute video purportedly shows the killing of five men who IS says were spying for the UK.

The authorities will also be carrying out voice-print analysis to match what is heard against individuals known to have travelled to Iraq and Syria.

The man threatens attacks in the UK and goes on to say that the video, which has not been independently verified, is a message for Prime Minister Cameron.

After the apparent killings the young boy, who seems to be aged about six or seven years old and is wearing military- style clothing, is seen pointing into the distance and talking about killing "unbelievers".

Commenting on the video for the first time since it was released, Cameron said: "It's desperate stuff from an organisation that really does do the most utterly despicable and ghastly acts and people can see that again today.

"But this is an organisation that's losing territory, it's losing ground, it's, I think, increasingly losing anybody's sympathy, and this again shows what an appalling organisation we're up against."

"They hate us not for what we do but for what we are - the fact that we are a successful, tolerant, democratic, multi-faith, multi-ethnic nation.

"They hate that and that's why they want to take us on and that's why they do what they do. But I know that Britain will never be cowed by this sort of terrorism. Our values are so much stronger than theirs. It may take a very long time but they will be defeated," he added.

In the video, the masked man who has a British accent and is holding a gun, mocks Cameron for daring to "challenge the might" of the extremist group.

He goes on to say: "We will continue to wage jihad, break borders and one day invade your land where we will rule by the Sharia."

The five men, wearing jumpsuits and kneeling in a desert location, then appear to be shot in the back of the head, after making what is claimed to be their confessions.

One of the men says he had been asked to provide information about the location of IS militants, including two Britons, apparently to help target them with air strikes.

Some of the five say they are from Raqqa in Syria while another says he is from Benghazi, Libya, but none say they are from the UK.

"We are examining the contents of the video and the Prime Minister is being kept updated on that. It serves as a reminder of the barbarity of Daesh [Arabic acronym for ISIS] and what the world faces with these terrorists. It's also clearly a propaganda tool and should be treated as such," a Downing Street spokesperson told reporters.