An Islamic State affiliate group Tuesday published a brutal video that showed terrorists forcing a prisoner in the Sinai Peninsula accused of being an Israeli spy to dig his own grave before executing him.

The video was disseminated by Sinai-based Ansar Bayt al-Maqdis, which is fighting an insurgency against the Egyptian government that recently swore allegiance to the Islamic State terror group.

The prisoner, dawning an orange jumpsuit similar to prisoners held elsewhere by IS affiliates, had been accused of spying on behalf of the Israeli Mossad spy agency.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

The video shows clips from his arrest up until his execution, reported the Daily Mail. The contents of the video could not be independently verified.

The clip is highly stylized in a fashion that has become a hallmark of Islamic State propaganda videos. The moments before his ultimate execution are shown in slow motion before a gunman suddenly comes up behind the kneeling captive and shoots him in the back of the head.

The video has been widely shared by IS-supporters on social media, particularly Twitter. It was posted to YouTube before being quickly taken down.

It is the second video from IS in the last month showing a man being forced to dig his own grave.

In May, another man accused of being a spy for Syria was beheaded in a clip that included a confession to his alleged crimes.

In March, IS released a video showing the execution of East Jerusalemite Muhammad Said Ismail Musallam, who was also accused of spying for the Mossad.