In a statement quoted by Associated Press, Isis said Wednesday's attack in Tunis was a "blessed invasion of one of the dens of infidels and vice in Muslim Tunisia."
The extremist group warned of further violence against "impure ones", in the message posted on an online forum. "What you have seen today is the first drop of the rain," Isis said in the statement.
Four Italians were among the 23 people killed when two gunmen stormed the Bardo Museum in the west of Tunis.
TGcom named two of the victims as Francesco Caldara, a 64-year-old pensioner from Novara, and Orazio Conte, a 54-year-old IT worker from Turin.
Caldara’s wife, Sonia Reddi, and Conte’s, Carolina Bottari, were both injured in the attack.
Spanish Foreign Minister Jose Manuel Garcia-Margallo said two Spanish citizens had lost their lives in the attack, but did not say whether any Spaniards were injured.
He said the victims were part of a group of tourists who had disembarked from two cruise ships to visit the Tunisian capital Tunis. One of the ships had 60 Spanish nationals on board, the other 30.
French president François Hollande announced late on Wednesday that two French nationals were among those killed.
In Poland, the speaker of the lower house, Radoslaw Sikorski, said "very likely seven Polish people were killed". The country's foreign ministry only confirmed 11 injured.
Colombia's President Juan Manuel Santos for his part confirmed two Colombian deaths.
A Tunisian bus driver and a Tunisian policeman also lost their lives when gunmen stormed the National Bardo Museum.
Security forces killed two attackers and were hunting for possible accomplices, the Tunisian premier said.
Gentiloni called for a "strong response from the international community" during a press conference on Wednesday evening, and said the Bardo attack would reinforce the country's "determination against terrorists".
Both the foreign minister and Matteo Renzi, Italy's prime minister, sent their condolences to the victims. "Our thoughts go out to the people involved, their families and the government of Tunisia," Renzi was quoted by Ansa as saying.
EU 'shocked' by terrorist attack
Donald Tusk, president of the European Council, said the EU "stands with Tunisia in its commitment to peace and democracy".
"I am shocked by today's terrorist attack at the Bardo museum in Tunis," Tusk said in a statement.
"The European Union and Tunisia will not be intimidated by terrorism, at home or abroad. We are ready to support the Tunisian government in its actions against violent extremism and commend its speedy action to free the hostages involved," he added.
The Bardo museum is internationally-renowned for its collection of mosaics and is visited regularly by groups of tourists, many disembarking from Mediterranean cruises.