Last week's attack, three months after a deadly assault on the Bardo museum in Tunis, has shocked the North African country emerging into a democracy following its 2011 revolution.
Tunisia's emergency laws temporarily give the government more executive flexibility, hand the army and police more authority, and restrict certain rights such as those dealing with public assembly and detention.
"Due to the terrorism risk, and the regional context, and spread of terrorism, we have declared a state of emergency," Reuters quoted Essebsi as saying in a televised address.
"The continued threat we face leaves the country in a state of war, where we have to use all measures necessary."
A Tunisian gunman, said to have been trained in a camp across the border in Libya, opened fire killing foreign tourists, mostly Britons, in the resort of Sousse on June 26.
The beach massacre struck a huge blow to Tunisia's tourism industry, prompting thousands of holidaymakers to leave and causing an estimated $500 million in losses for a sector that makes up seven percent of the economy.