How big is Tunisian militant threat?
Once regarded as a beacon of secularism in the Arab world, Tunisia has seen militant Islamists gain strength since the overthrow of long-serving ruler Zine al-Abidine Ben Ali in a popular uprising in 2011.
The attack on the famous Bardo museum in the capital, Tunis, was the deadliest since the revolution, with at least 23 people - mostly European tourists - killed.
The Islamic State (IS) has said it carried out the attack - the first by the group in Tunisia.
This would suggest IS is extending its influence in North Africa, following the series of high-profile attacks it has carried out in neighbouring Libya this year, including the bombing of an upmarket hotel and the beheading of Egyptian Coptic Christians living there.
Tunisian authorities say up to 3,000 of its citizens have gone abroad to wage jihad - including to Syria and Iraq, the birthplace of IS - making them the largest number of foreign fighters to join the group's ranks, according to some researchers.
Some of the militants are now said to have returned, increasing the security threat.
The attack is a big blow to Tunisia's new secular-led government, which vowed to take a tougher line against the militants after it defeated the moderate Islamist Ennahda party in elections last year.
Having won the first post-revolution election, Ennahda was accused of being soft on jihadist groups - a perception which grew after leading secular politicians Chokri Belaid and Mohamed Brahmi were assassinated in 2013.
Tunisia has also battled fighters linked to al-Qaeda in the Islamic Maghreb (AQIM) along its border with Algeria.
The group has carried out a spate of attacks on security forces in Tunisia's mountainous region - at least 14 soldiers were killed in a raid on two checkpoints in July 2014, the heaviest death toll recorded by the army since independence from France in 1956.
That attack came despite the fact that the military had been carrying out an air and ground offensive since 2012 to eliminate the militant threat.
But the setback was not surprising - Tunisia has one of the smallest armies in the region, with little experience in counter-terrorism, though its troops have been receiving training and equipment from Europe and the US.
Within Tunisia, the main Islamist group is Ansar al-Sharia. Designated a terrorist group, it was accused of attacking the US embassy in Tunis in September 2012.
The group is led by Abu Ayadh al-Tunisi, who was pardoned and released from prison after the overthrow of former President Ben Ali's regime as part of efforts to promote reconciliation.
An arrest warrant has been reissued for him following claims that the group has been involved in violence, including the attack on the US embassy and the killing of Mr Belaid and Mr Brahmi.
It denies the allegations, and says it is campaigning peacefully for Islamic law to be implemented in Tunisia.
Ansar al-Sharia has built support through humanitarian work, especially in neighbourhoods where unemployment and poverty levels are high.
Some analysts believe that although its support base is small, Ansar al-Sharia's grassroots mobilisation - and links to IS - makes it the biggest threat to Tunisia's record as the only Arab state to achieve a successful political transition following the uprisings that spread through the region in 2011.
Correction 20 March: An earlier version of this story incorrectly stated that Ahmed al-Rouissi was the same person as Abu Ayadh al-Tunisi