Tunisia, already destabilised by a political crisis, suffered a blow to its vital tourism industry after a suicide bombing and another that was foiled in two coastal resort towns.
Only the suicide bomber was killed Wednesday in an attack on a beachside hotel in Sousse, and the security forces thwarted another attempted suicide attack soon after in neighbouring Monastir.
The interior ministry said its special forces arrested five Salafist "terrorists" directly linked to the first suicide bids in the North African country for more than a decade.
It said those behind the attacks belonged to Ansar al-Sharia, Tunisia's main Salafist movement, which the authorities have designated a "terrorist organisation" with ties to Al-Qaeda.
The presidency insisted the attacks, which have yet to be claimed, would not "derail" the democratic transition.
It was referring to a national dialogue underway between the ruling Islamist party Ennahda and the opposition to end months of political crisis, sparked by the July assassination of opposition politician Mohamed Brahmi by suspected jihadists.
As part of a roadmap agreed by political leaders to break the political stalemate, Ennahda is to be replaced and a new prime minister named.
Ennahda's veteran leader Rached Ghannouchi, who has been criticised in the past for encouraging dialogue with hardline Salafists, denounced "those who tried to target tourists," calling them "criminals who want to destroy Tunisia, its economy and its democratic transition".