Tunisia President Beji Caid Essebsi declared a state of emergency on Saturday to hand his government more authority following an Islamic militant attack on a beach hotel, where 38 foreign tourists, mostly Britons, were killed.

Tunisia's emergency law temporarily gives the government more executive flexibility, hands the army and police more authority, and restricts certain rights such as the right to public assembly.

The statement from the president's office said Essebsi would give a speech on national television to give more details at 1600 GMT(12:00 p.m. EDT).

The attack on the Sousse beach resort last Friday followed a gun attack on the Bardo museum in Tunis in March: two of the worst militant assaults in Tunisia's modern history, and a pressing threat to its vital tourist industry.

Tunisian officials say all three gunmen in those two attacks had been trained at the same time, over the border in jihadist camps in Libya, where a conflict between two rival governments has allowed Islamist militant groups to gain ground.

Tunisia last had a state of emergency during the 2011 uprising against autocrat Zine el-Abidine Ben Ali.

(Reporting by Tarek Amara; writing by Patrick Markey; Editing by Kevin Liffey)