ALMATY/MOSCOW: Kazakh security forces killed five suspected militants linked to deadly attacks this week, the National Security Committee (KNB) said on Friday.

The militants are said to have challenged the stability of the energy-rich ex-Soviet nation of Kazakhstan.

A special forces unit stormed an apartment and killed four suspects after they refused to surrender and opened fire, the KNB said in a statement. There were no casualties among civilians or security forces.

At least 20 people were killed in Aktobe on Sunday when groups of gunmen attacked a military base and gun shops. Kazakhstan’s authorities described the violence as a terror attack and blamed it on religious extremists. Police and security forces have launched a sweeping hunt for those involved.

Kazakhstan’s President Nursultan Nazarbayev said on Wednesday the attackers had received instructions from abroad and were adherents of a pseudo-religious movement, but did not identify it. The KNB said it was continuing the search for some more attackers.

The violence has shaken Kazakhstan and set a serious challenge to 75-year old President Nursultan Nazarbayev, who has led the energy-rich Central Asian nation since before before the 1991 Soviet collapse. He has maintained a tight grip over the nation’s political system, winning his fifth presidential term in 2015 with 98 percent of the vote.

Kazakhstan’s economic fortunes have collapsed due to slumping prices for oil, its main currency earner, and the economy is expected to slow to 0.5 percent growth this year. On top of economic problems, a new law allowing foreigners to own agricultural lands has fueled discontent and triggered protests across the country.

Some observers saw the attacks as a sign of an intensifying battle for influence among political clans in Kazakhstan, while others have pointed at possible foreign influence.

In an address to the nation earlier this week, Nazarbayev said “adherents of radical pseudo-religious movements who got their instructions from abroad” were behind the attacks, an apparent reference to radical groups.

“Someone has tried to test how strong our state is,” he said, vowing to take unspecified additional steps against those who try to destabilize the society and the country.

One of the men blamed by authorities for the attack, the deadliest since the country became independent of the Soviet Union in 1991, had posted a video online sympathetic to Daesh.

A message issued on May 21, purporting to come from a spokesman for Daesh, called on followers abroad to launch attacks during the holy month of Ramadan, which began in early June.

A Russian version of the message can be found on social network Vkontakte, popular in the former Soviet Union and used by several people who were on the list of Aktobe suspects leaked to Kazakh media.

“Such groups (of Daesh supporters) probably exist everywhere but ours, the Aktobe one, were among the first to react to this fatwa,” said Astana-based religion researcher Asylbek Izbairov.

“Perhaps this was due to their links to Kazakh militants who have joined the Islamic State and traveled there.”

Galym Shoikin, head of religious issues committee at Kazakhstan’s culture ministry, told reporters on Friday that an estimated 300 Kazakhs had left the country to join the militant group based in Syria and Iraq, half of them potential fighters and the other half their family members.