Tunisia has detained 12 people in connection with an attack last week that killed 38 people, an official said Thursday.

Security forces killed the gunman following the mass shooting Friday in the city of Sousse. Officials said he was the only shooter. But they have been searching for people who may have given him help before the attack.

The Islamic State group claimed responsibility, just as it did when two gunmen killed 21 people at the Bardo museum in Tunis in March. Most of the dead in both attacks were foreign tourists.