TUNIS - Tunisian President Beji Caid Essebsi on Saturday declared a state of emergency following last week’s beach massacre claimed by the Islamic State group in which 38 foreign tourists were killed.

In another firm response to the June 26 attack, several officials were sacked including the governor of the Sousse region where it took place. The North African state, which has seen an exodus of tourists, has admitted that its security services were unprepared for the seaside attack in Port El Kantaoui and that police were too slow to respond.

“The president has declared a state of emergency in Tunisia” and was to address the nation, Essebsi’s office said, adding that it would be implemented for a renewable 30-day period. A state of emergency, granting special powers to the police and army, was in force for two years up until March 2014, following longtime secular president Zine El Abidine Ben Ali’s ouster in a 2011 revolution.

Apart from barring strike action and unauthorised meetings, the measure allows the authorities to carry out raids on homes at any time of the day and to keep tabs on the media. Independent political analyst Selim Kharrat questioned the timing of Essebsi’s announcement, eight days after the beach attack, and warned that a state of emergency “could become an excellent tool of repression”.

An aide to Tunisia’s prime minister said Saturday that several officials including the Sousse governor and from the assailant’s home town and from where he studied, as well as police officers, had been sacked. “Just as there have been security failures, there have also been political failures,” the premier’s communications adviser Dhafer Neji told AFP. Tunisia has faced a post-revolution surge in jihadist violence in which dozens of police and soldiers have been killed. The beach shooting was the second such rampage in three months, after another jihadist attack at the National Bardo Museum in Tunis on March 18 that killed 21 tourists and a policeman. Tunisia had already stepped up security after the museum attack and announced in the wake of the beach killings that it would deploy armed guards on beaches and close 80 mosques suspected of fanning Islamist extremism.

On Friday, Prime Minister Habib Essid acknowledged that police had taken too long to respond to the attack in Port El Kantaoui near Sousse. “The time of the reaction - this is the problem,” Essid said.

told the BBC in an interview. Police had been “blocked everywhere”, he added. Essid spoke as Britain’s Queen Elizabeth II and Prime Minister David Cameron led a minute’s silence for the victims, 30 of whom were British.

Tourists fled in horror as a Tunisian identified as 23-year-old Seifeddine Rezgui pulled a Kalashnikov assault rifle from inside a furled beach umbrella and went on a shooting spree outside a five-star hotel. Three Irish nationals, two Germans, one Belgian, one Portuguese and a Russian were also killed before the assailant was himself shot dead.

On Thursday, Tunisia announced it had arrested eight people, including a woman, “with direct links” to the attack. Tunisian authorities have said Rezgui received weapons training from jihadists in neighbouring Libya, travelling to the chaos-wracked country at the same time as the two young Tunisians behind the Bardo attack. Over the past four years, dozens of security forces have been killed in Tunisia in clashes and ambushes attributed to jihadists — mainly in the western Chaambi Mountains on the border with Algeria.

Disillusionment and social exclusion as well as economic woes have fuelled radicalism among youths in Tunisia. About 3,000 Tunisians have gone to Iraq, Syria and Libya to join jihadist ranks. The jihadist attacks have dealt a heavy blow to the tourism sector which contributes between seven and eight percent of Tunisia’s GDP. The sector accounts for 400,000 jobs, directly and indirectly, and is a key source of foreign revenue for a country where the local currency, the dinar, is non-convertible. The economic impact of the beach bloodbath, on top of the upheaval following the overthrow of Ben Ali, is likely to exceed half a billion dollars for 2015, according to Tourism Minister Selma Elloumi Rekik. Moreover, several Tunisian officials including the governor of Sousse have been sacked after the jihadist attack on a beach resort that killed 38 tourists, an aide to the premier said Saturday.

“Just as there have been security failures, there have also been political failures,” the prime minister’s communications adviser Dhafer Neji told AFP. He said those fired included the governor of the Sousse region where the June 26 attack took place, as well as police officials. Among the policemen dismissed were three from Sousse, one from Gaafour, the home city in the northwest of the jihadist who carried out the attack in Port El Kantaoui, and one from Kairouan where he was studying, he added.

Interior ministry spokesman Mohamed Ali Aroui confirmed that “several (police) officials have been dismissed at Sousse and Kerouan,” including the chief of the Sousse region. The gunman who killed the tourists — among them 30 Britons — was 23-year-old student Seifeddine Rezgui, who was himself shot dead by police after his deadly rampage. The security forces were criticised after the attack for not reacting quickly enough, after witnesses said at least 30 minutes elapsed before police arrived. On Friday, the authorities admitted for the first time that there had been security failures, with Prime Minister Habib Essid saying: “The time of the reaction — this is the problem.”