Officials did not confirm the claim, but said they had identified the two militants shot dead by security forces after opening fire on tourist buses visiting the Bardo museum inside Tunisia’s heavily guarded parliament compound on Wednesday.
Japanese, Italian, Spanish and British visitors, as well as three Tunisians, were among the victims.
The assault was the most deadly attack involving foreigners in Tunisia since a 2002 suicide bombing in Djerba.
It came at a fragile moment for a country just emerging to full democracy after its pioneering popular uprising four years ago.
It is heavily reliant on foreign tourists to its beach resorts and desert treks, and the government was about to tackle politically sensitive reforms aimed at boosting economic growth.
The IS militant group, which has declared a caliphate in large parts of Iraq and Syria and is active in Tunisia’s chaotic neighbour Libya, praised the two attackers in an audio recording in Arabic, calling them “knights of the Islamic State” armed with machineguns and bombs.
Tunisians make up the one of the largest contingents of foreign fighters in Syria, Iraq and Libya, and their homeland’s young democracy, which has cracked down on militancy at home, was a clear potential target.
The two dead militants were identified as Tunisians, Hatem al-Khashnawi and Yassin al-Abidi.
Two local newspapers reported Abidi had spent time in Iraq and Libya, but officials did not confirm that.
Tunisia’s prime minister Habib Essid said Abidi had been under surveillance but “not for anything very special”.
“We have identified them, it is indeed these two terrorists,” the premier told French RTL radio earlier yesterday. “Their affiliation is not clear at the moment.”
Authorities said they had arrested four people directly linked to the attack and five others with indirect ties. A security source said two family members of one of the gunmen were among those held.
“We arrested the father and the sister of the terrorist Hatem Al-Khashnawi in the their home in Sbiba City,” the source said.
The president’s office said the army would be deployed to the streets as part of increased security following the attack.
“After a meeting with the armed forces, the president has decided large cities will be secured by the army,” it said.
The number of foreign tourists killed rose to 20 from 17, the health minister said.