President Beji Caid Essebsi said the country was facing a special type of war and the emergency situation would be enforced for a 30-day period.
The state of emergency grants special powers to the police and army and allows the authorities to carry out raids on homes at any time.
In another response to the attack, several officials have been sacked, including the governor of the Sousse region where it took place.