Fanatics from the Islamic State terror group have beheaded one of their own commanders after accusing him of being an MI6 agent, according to reports.

Abu Ubaida Almaghribi, head of IS security in Aleppo, northern Syria, was once in charge of a prison where American journalist James Foley and other Western hostages were held.

But he has now been executed after fellow extremists accused him of passing on information about IS activities to the UK.

Scroll down for video

Abu Ubaida Almaghribi, head of IS security in Aleppo, northern Syria, has been executed after fellow extremists accused him of being an MI6 agent, according to reports. Above, this grainy image is thought to be Abu Ubaida

Abu Ubaida is believed to be a Dutch national of Moroccan descent, although his real identity is not known. IS claimed he was executed a day after video footage of Mr Foley’s beheading emerged on YouTube.

A former IS prisoner last year told Belgian state prosecutors that Abu Ubaida was in charge of security when he and Mr Foley were held there last year.

Last night the Foreign Office declined to comment on the claims, circulated by Moroccan and Jordanian news agencies.

A security source said: ‘In the past, other extremist groups and states have made claims of spying as a justification for executing one of their own.’ He added that the IS message may have been passed on to the local media by a third party.

Execution: Abu Ubaida was once in charge of a prison where American journalist James Foley and other Western hostages were held. Above, Mr Foley is pictured in a sickening video that captured his execution

A report by Moroccan news outlet Alyoum24 said: ‘Ubaida Almaghribi, who is originally from Morocco, and served as the head of intelligence services of the ISIS organisation in Aleppo, Syria, was beheaded after being accused of reporting information on the activities, movements, and plans of ISIS to the UK.’

Morocco World News stated: ‘ISIS militants reportedly beheaded a group of prominent leaders including Abu Ubaida Almaghribi, because of doubts regarding their allegiance and work for foreign entities.’

Mike Doran, a Middle East expert at the Washington-based Brookings Institution, said the alleged execution was a sign of ‘nervousness’ within IS’s higher ranks.

Rebels: More than 500 British jihadis have joined the ranks of IS and other extremist groups in Syria and Iraq, but nearly half have returned home, offering opportunities to gain intelligence. Above, ISIS rebels in Syria

Belgian jihadi Jejoen Bontinck, from Antwerp, returned home last year and is understood to have given Western intelligence agencies, including MI6, vital information about the group that was holding Mr Foley and other prisoners in Aleppo.

He said Abu Ubaida was a Dutch jihadi who was head of security at the prison.

The 19-year-old said he and Mr Foley were held for at least three weeks by a group of Belgian jihadis called Shariah4Belgium, who accused him of being a traitor because he wanted to go home. But when the terror group pulled out of Aleppo last year, the prisoners were taken to the IS stronghold of Raqqa. It is thought that it was then that Bontinck either escaped or was freed.

In the past, other extremist groups and states have made claims of spying as a justification for executing one of their own Security source

According to Bontinck, the so-called ‘Beatles’, who are allegedly responsible for Mr Foley’s murder, were not part of the group that held them in Aleppo. They were first identified after the transfer to Raqqa.

Western security agencies, including MI6, have been working hard to get intelligence on IS but the speed of the group’s advance across Syria and Iraq has left them flat-footed.

More than 500 British jihadis have joined the ranks of IS and other extremist groups in Syria and Iraq, but nearly half have returned home, offering valuable opportunities to gain intelligence.

Philip Balboni, the chief executive of GlobalPost, the American news site for which Mr Foley worked, has confirmed Bontinck was held with the journalist.