Tunis (AFP) - An explosion targeting a bus carrying presidential guards Tuesday killed at least 12 officers in the heart of the capital of Tunisia, the target of jihadist violence since the 2011 revolution.

A security source at the site said "most of the agents who were on the bus are dead".

The blast, described as an "attack" by presidential spokesman Moez Sinaoui, struck on the capital's Mohamed V Avenue, a ministry official told AFP.

Twenty people were wounded.

President Beji Caid Essebsi, who cancelled a trip to Switzerland for Wednesday, declared a state of emergency throughout the country and curfew in the capital.

"As a result of this painful event, this great tragedy... I proclaim a state of emergency for 30 days under the terms of law and a curfew in greater Tunis from 9:00 pm (2000 GMT) until 5:00 am tomorrow," he said in brief a televised address.

Sinaoui later told AFP the curfew would continue to be imposed until further notice.

The attack, which has still not been claimed, took place as this year's 26th Carthage Film Festival was in full swing.

Festival director Brahim Letaief had already cancelled the night's screenings, saying he hoped the showcase for African and Arab film-makers could resume on Wednesday.

"That is the only way to respond to these barbaric acts," he told AFP.

Prime Minister Habib Essid and Interior Minister Najem Gharsalli went to the scene of the blast.

An AFP journalist reported seeing the partly burnt-out shell of the bus, with police, ambulances and fire trucks at the scene.

Many people were in tears.

A bank employee working nearby reported hearing a large explosion and seeing the bus on fire.

- IS attacks on foreigners -

While there was no immediate claim of responsibility, Tunisia has been plagued by Islamist violence since the 2011 overthrow of longtime dictator Zine El Abidine Ben Ali, and dozens of members of the security forces have also been killed.

Two attacks this year claimed by the Islamic State group targeted foreigners -- at the National Bardo Museum in March, killing 21 tourists and a policeman, and at a resort hotel in Sousse in June, killing 38 tourists.

Story continues

A state of emergency was imposed after the Sousse massacre and later renewed before being lifted at the beginning of October.

On Sunday, a jihadist group claimed the beheading of a young Tunisian shepherd on behalf of IS, accusing him of having informed the army about their movements in the central province of Sidi Bouzid.

The killing of 16-year-old Mabrouk Soltani on November 13 sparked anger in Tunisia. His killers ordered a 14-year-old who was working with him to bring the victim's head wrapped in plastic to his family.

The video in which the claim was made, whose authenticity could not be confirmed, claimed the young shepherd gave information on "the soldiers of the Islamic State" to the Tunisian army.

That was denied by the government.

The interior ministry regularly announces the arrest of suspected jihadists.

Seven women were recently detained for engaging in pro-IS propaganda, while 20 people were arrested on suspicion of planning attacks on hotels and security facilities.

Thousands of Tunisia citizens are fighting in neighbouring Libya, as well as in Iraq and Syria on the side of jihadists.