Tunisian security officials said on Wednesday a suicide bomber carried out the attack on a presidential guard bus, killing at least 13 and forcing the government to impose a nationwide state of emergency.
Tuesday's blast on a main boulevard in the capital underscored Tunisia's vulnerability to Islamist militancy following the gun assaults on a Sousse hotel in June and the Bardo Museum in Tunis in March, both claimed by Islamic State.
No group claimed responsibility for Tuesday's attack. But Tunisia has increasingly become a target for militants after being hailed as an example of democratic change since its 2011 uprising ousted autocrat Zine Abidine Ben Ali.
"This is an evolution in the behavior 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 also 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.
Troops and armed police patrolled the city streets and set up checkpoints searching vehicles and pedestrians. At Tunis international airport security forces were allowing in only passengers traveling.
Security officials said the bomber blew himself up as presidential guards were boarding a bus on the main Mohamed V Avenue to travel to the presidential palace for duty.
"According to the preliminary details, 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 Shems FM radio.
One of the most secular countries in the Arab World, Tunisia has enjoyed relative stability since its 2011 uprising compared with its North African neighbors Libya and Egypt. It has a new constitution, free elections and a compromise politics between secular and Islamist parties that has allowed progress.
But fighting Islamist militants has become a major challenge for a country heavily reliant on tourism for its revenues.
In the early chaotic days after its revolution, ultra-conservative Islamists gained ground and recruited among young Tunisians and took over mosques.
More than 3,000 Tunisians are now fighting for Islamic State or other militant groups in Iraq, Syria and neighboring Libya. Some have threatened to return to carry out attacks in Tunisia. The gunmen in the Sousse and Bardo attacks were all trained in jihadist camps in Libya.
The government has cracked down on hardline preachers and taken back mosques. It is also building a security wall along the border with Libya to try to stop militants crossing over into its territory.