Tunisian authorities said on Wednesday a suicide bomber wearing a vest packed with plastic explosive blew up a presidential guard bus a day earlier, killing at least 12 troops in an attack claimed by Islamic State militants.
Tuesday's explosion on a main boulevard in the capital drove home the vulnerability of Tunisia to Islamist militancy, following assaults on a seaside tourist hotel in June and the Bardo Museum in Tunis in March also claimed by Islamic State.
One of the Arab world's most secular nations, Tunisia has increasingly become a target for militants after being hailed as a beacon of democratic change in the region since its 2011 uprising ousted autocrat Zine Abidine Ben Ali.
"This attack is an evolution in the behaviour of the terrorists, this time they attacked a symbol of the state and in the heart of the capital," Prime Minister Habib Essid told reporters after an emergency security meeting.
It was the first suicide bombing in the capital. In October 2013 a bomber blew himself up on a beach in Sousse, and previously an al Qaeda suicide bomber attacked the synagogue in Djerba, killing 21 people.
Islamic State, whose insurgents control large parts of Iraq and Syria and are also active in Libya to Tunisia's east, claimed responsibility on Wednesday for the Tunis attack, according to an official statement.
It included a photograph of a man, wearing a headscarf, a white robe and bomb vest, who it said was the bomber and named him as Abu Abdyllah Tounsi. The name suggests he was Tunisian himself.
"The Tyrants of Tunisia must know there is no safety for them. We will not stop until the laws of Allah are applied to Tunisia," the statement said.
SEMTEX FROM LIBYA
An Interior Ministry statement said 12 guards died in the blast of Semtex explosive located in a belt the bomber was wearing. The explosives had been traced to Libya, it said. Another body at the scene was probably that of the bomber.
Security officials said the bomber detonated his blast just as presidential guards were boarding a bus on Mohamed V Avenue to travel to the presidential palace for duty.
"The attacker was wearing a bag on his back. He had on a coat and was wearing headphones. He blew himself up just getting into the door of the bus with military explosives," Hichem Gharbi, a presidential security official, told local radio.
The government has declared a state of emergency for a month giving the executive and armed forces more flexibility and authority, but also temporarily curbing some rights.
Around Tunis on Wednesday, troops and armed police patrolled city streets and set up checkpoints searching vehicles and pedestrians. At Tunis international airport, security forces were allowing in only people with booked flights.
Tunisia has enjoyed relative stability since its uprising compared with neighbours Libya and Egypt. It has a new constitution, held free elections and established compromise politics between secular and Islamist parties that has allowed some progress.
But Islamist militants now pose a serious challenge for a country heavily reliant on tourism for its revenues.
In the early chaotic days after its revolution, ultra-conservative Islamists gained ground, recruiting among young Tunisians and taking over mosques.
More than 3,000 Tunisians are now fighting for Islamic State or other militant groups in Iraq, Syria and neighbouring Libya. Some have threatened to return to stage attacks in Tunisia.
The gunmen in the Sousse hotel and Bardo Museum attacks were all trained in jihadist camps in Libya.
The Tunis government has cracked down on hardline preachers and taken back mosques. It is also building a security wall along the border with lawless Libya to try to stop militants crossing over into its territory.
Another group of militants is also holed up in the remote mountains bordering Algeria, and they have carried out hit-and-run attacks on Tunisian military patrols and police checkpoints.