ABU DHABI - The United Arab Emirates is to try 41 people for allegedly seeking to overthrow the government to set up an Islamic State group-style caliphate in the Gulf state, prosecutors said Sunday.

Such mass trials on terrorism charges are rare in the UAE which has largely been spared the Islamic militancy that has hit other Arab states.

The suspects, who include Emiratis as well as foreigners, are accused of setting up a group "with a terrorist, takfiri (Sunni Muslim extremist) ideology," in a bid to "seize power and establish a caliphate," the prosecutor general said. They are accused of setting up cells to train members in handling weapons and the manufacture of explosives in preparation for attacks on UAE soil.

Prosecutors charge that they were "in contact with foreign terrorist organisations... to help them achieve their goals." The UAE is part of the US-led coalition that has been carrying out air strikes against IS in Syria since September last year and has upped security measures since the wave of Arab Spring protests that swept the region four years ago.

In July, following the murder of an American teacher in an Abu Dhabi mall, authorities enacted tougher anti-terror legislation, including harsher jail terms and even introducing the death penalty for crimes linked to religious hatred and "takfiri groups". Takfiris regard Muslims who do not follow their extreme interpretation of Islam as apostates punishable by death.

It is the ideology of Al-Qaeda as well as IS. Alaa Bader al-Hashemi, 30, was executed last month for December's stabbing murder of Ibolya Ryan, 47. Hashemi's execution was the first in the oil-rich Muslim federation since January 2014 when a Sri Lankan was put to death by firing squad for murdering an Emirati man in 2006.

Before her execution, human rights watchdog Amnesty International had reported last year that a dozen people had been put to death in the UAE since 1997. The prosecutor said Sunday that the cell was highly organised, operating under a "hierarchy" to recruit young Emiratis, obtain weapons and manufacture explosives, and spread Islamist propaganda.

It is the second time in recent years that the UAE has carried out a mass trial on terrorism charges. Like neighbouring Saudi Arabia, the UAE regards the Muslim Brotherhood, the party of ousted Egyptian president Mohamed Morsi, as a terrorist organisation. In 2013, it sentenced 60 people to jail terms of between seven and 15 years for links to the Brotherhood in the first trial of its kind in the country.

The Brotherhood is one of dozens of Islamist-inspired groups outlawed in the UAE in a blacklist that extends far beyond the jihadists of IS and Al-Qaeda. Human rights groups have raised concerns that the blacklist is intended to stamp down on even peaceful dissent. The Emirates remains a key Western ally in the fight against IS, having last month established with US backing a centre to counter the jihadists' propaganda.

The extremist group, which controls large areas of Iraq and Syria, has carried out a series of attacks in the Gulf, including bombings of Shiite mosques in both Saudi Arabia and Kuwait.