By Saud Mehsud

DERA ISMAIL KHAN, Pakistan (Reuters) - A group of Pakistani and Afghan militants have beheaded a Pakistani soldier after pledging allegiance to Islamic State, according to a new video released online, copying execution tactics used by the Middle East jihadist group.

Islamic State, which controls large areas of Iraq and Syria, has gained a foothold in Pakistan and Afghanistan in the past year, with a number of former Taliban militants setting up a new group purporting to represent IS interests in the region.

Little is known about its activities or its size. It remains unclear whether IS-inspired militants hiding on the Pakistani-Afghan border are acting on their own or on direct orders from the IS leadership in the Middle East.

In the latest Arabic-language video, whose authenticity could not immediately be confirmed, a large group of turbaned militants, many on horseback and holding rifles and black IS flags, are seen gathered in an undisclosed forested area.

A militant identified by the SITE intelligence group as former Pakistani Taliban spokesman Shahidullah Shahid is then seen addressing the crowd to announce pledges of allegiance to IS from leaders of various groups in Afghanistan and Pakistan.

"We want to inform you that we have brought together the emirs of 10 groups who want to pledge their allegiance to the Caliph Abu Bakr al-Baghdadi," he said, referring to the IS leader.

At the end of the 16-minute video a man wearing a helmet, a T-shirt and combat trousers, identified as a Pakistani soldier, is seen being beheaded with a machete.

According to SITE, those present during the execution included both Afghan and Taliban militants but nothing was known about the beheaded soldier or how he was captured.

IS's radical ideology appears to have inspired many fighters operating across the region, posing a possible challenge to more established local groups such as the Taliban.

But, while some fighters switched sides to declare allegiance to IS in the past year, most Taliban insurgents remained staunchly loyal to Mullah Mohammad Omar, an Afghan Taliban leader who has been at the helm of the movement since the 1990s.

Videos of beheadings, popularized by IS, are not commonplace in the Afghanistan-Pakistan region, although the Taliban and other local militant groups often resort to similarly gruesome attacks against security forces and civilians.

(Additional reporting by Angus McDowall and Yara Bayoumy in Dubai, Writing by Maria Golovnina; Editing by Gareth Jones)