The blasts killed a police officer and wounded at least eight people including several civilians.

Double suicide attacks shook Tunisia's capital Thursday, even as the country was plunged into uncertainty with the hospitalisation of President Beji Caid Essebsi who was said to be "seriously ill".

The Islamic State group claimed responsibility, saying the "executors of the two attacks on Tunisian security elements" were its "fighters", according to US-based monitor SITE Intelligence Group.

The violence revived fears for the stability of the North African state, which is seen as a rare democratic success story of the 2011 Arab Spring uprisings but has been hit by repeated Islamist attacks.

Thursday's blasts -- one on a central avenue and another against a security base -- killed a police officer and wounded at least eight people including several civilians, the interior ministry said.

An AFP correspondent saw body parts strewn in the road around a police car after the first attack, which took place on Habib Bourguiba, a central avenue near the old city.

The interior ministry said one policeman died from his wounds after that blast, while another policeman and three civilians were wounded.

"It was a suicide attack," interior ministry spokesman Sofiene Zaag told AFP.

Half an hour later, the second attack targeted a base of the national guard, judicial police and the anti-terror branch in the capital.

"An individual blew himself up outside the back door" of the base, wounding four security personnel, Zaag said, adding that both bombers were men.

Ambulances and emergency services vehicles quickly arrived on the scene as security forces kept onlookers at a distance.

Body parts lay on the sidewalk near the police vehicle that was targeted, including the head and feet of the bomber.

Onlookers shocked

Some onlookers rushed to take pictures, while others fainted in shock or left the scene in tears.

"Get out of here! What are you filming? Go away! Go home," officers shouted as they tried to push people behind a police cordon.

Several shops and offices closed amid the panic.

Just hours after news of the attacks broke, the presidency announced that Essebsi "was taken seriously ill and transferred to the military hospital in Tunis".

Key adviser Firas Guefrech described the 92-year-old leader as in "critical condition" and in a later tweet said that Essebsi was "stable", urging supporters to pray for his recovery.

Prime Minister Youssef Chahed said on Facebook he had paid a visit to the ailing president.

"I would like to reassure Tunisians that the president is receiving the necessary care," he said, warning against the dissemination of "false and confusing information".

Essebsi, the country's first democratically elected president, came to power in 2014, three years after the Arab Spring uprising toppled longtime dictator Zine El Abidine Ben Ali and sparked revolts in several Arab nations.

Civil protection units and police rapidly deployed to Habib Bourguiba avenue, where the interior ministry is located

"It is a cowardly terrorist operation... (to) destabilise Tunisians, the economy and democratic transition," Chahed told reporters, noting that it happened as the tourist season was in full swing.

"These (terrorist) groups don't belong in Tunisia and our war against them is... a question of life or death," the prime minister added.

Upcoming elections

Sofiene Sliti, spokesman for the anti-terror prosecutors, said the suicide bombers wore explosive vests.

The twin attacks also came ahead of presidential and legislative elections, scheduled for October and November.

In April, Essebsi said he did not plan to stand for re-election in order to make way for someone younger.

The veteran politician served as an adviser to Habib Bourguiba, the father of Tunisia's independence from France, holding a number of key jobs under him and later under Ben Ali.

Tunisia, the cradle of the Arab Spring uprisings, has been hit by repeated Islamist attacks since the overthrow of Ben Ali.

On October 29, 2018 an unemployed graduate blew herself up near police cars on Habib Bourguiba avenue, killing herself and wounding 26 people, mostly police officers, according to the interior ministry.

The Tunisian authorities said she had sworn allegiance to IS.

That attack was the first to rock the Tunisian capital for over three and a half years.

In March 2015, jihadist gunmen killed 21 tourists and a policeman at the National Bardo Museum in Tunis.

In June that year, 30 Britons were among 38 foreign holidaymakers killed in a gun and grenade attack on a beach resort near the Tunisian city of Sousse.

And in November 2015, a suicide bombing against a bus carrying presidential guards killed 12, in an attack claimed by IS.