TUNIS (Reuters) - Tunisian security forces killed a senior commander in an Islamist group who detonated his suicide belt as he was shot during a raid against militants planning attacks during the holy month of Ramadan, officials said on Sunday.

Tunisia’s armed forces have been cracking down on militants allied to Islamic State and al Qaeda’s North Africa branch, especially since the country suffered four major attacks in the last two years, including two against foreign tourists.

The clashes came on Sunday when national guard special forces raided a house where the group had been under surveillance for weeks, after communications about a possible attack were intercepted, National Guard spokesman Col. Major Khelifa Chibani said.

Another militant was killed and three others arrested in the raid on a house in Sidi Bouzid, a town 200 km (125 miles) southwest of the capital, Tunis.

“National Guard special forces killed two terrorists, including a commander of Okba Ibn Nafaa ... ” Chibani said by telephone. “They had been in the Sammama mountains, and planned attacks during Ramadan.”

He did not give any details on the potential attack, but Tunisia has been on alert since militant gunmen attacked the Sousse beach resort in 2015, killing more than 30 foreigners and badly damaging the vital tourist industry.

Another security source said the commander was an Algerian militant, but did not give his name.

The Okba Ibn Nafaa has mostly been based in remote Chaambi mountain range along the border with Algeria, where the army has been trying to flush them out for several years. Militants have in the past carried out raids on checkpoints and towns nearby.

They have mostly claimed loyalty to Al Qaeda in the Islamic Maghreb, al Qaeda’s North Africa branch still led by veteran Algerian militants hiding over the border in the mountains in eastern Algeria.

But Okba Ibn Nafaa brigade, which takes its name from an 7th century Arab general who led the Muslim conquest of North Africa, has split, with some of its fighters going to Islamic State ranks and hiding in the Sammama mountains, according to Tunisian security sources.

More than 3,000 Tunisians left over the last few years to fight for Islamic State and other militant groups in Iraq, Syria and Libya, and Tunisian authorities are trying to prepare for potential security threat from many of them returning.

Islamic State claimed most of major attacks in Tunisia, including the Sousse hotel attack and the Bardo museum attack, which killed dozens of foreign tourists in 2015, and raids by militants crossing from Libya into Tunisia’s Ben Guerdane in 2016.