The state of emergency gives security forces more powers and limits the right of public assembly.
Tunisian authorities had already tightened security, deploying more than 1,400 armed officers at hotels and beaches.
President Beji Caid Essebsi said in a national address that “exceptional measures” were needed.
“In order to face up to this scourge we need to be prepared. We need to have enough troops, proper training and material means – we are in desperate need of material means,” he said, appealing for international counter-terrorism support and co-operation.
The state of emergency will be in place for a renewable period of 30 days.
An official from PM Habib Essid’s office said several officials had been sacked in the wake of the attack, including the governor of Sousse.
“Just as there have been security failures, there have also been political failures,” Dhafer Neji told AFP.
Security forces were criticized for not responding more quickly to the attack on June 26 in Sousse, when a gunman opened fire on tourists on a beach and in a hotel before being shot dead by police.
The gunman has been identified as student Seifeddine Rezgui, who authorities say had trained in Libya.
PM Habib Essid said Seifeddine Rezgui had probably trained with the Ansar al-Sharia group, though Islamic State (ISIS) earlier said it was behind the attack.
Eight people have been arrested on suspicion of collaborating with Seifeddine Rezgui, and the government says it has uncovered the network behind the Sousse attack.
Authorities have also pledged to close some 80 mosques that were operating outside government control and accused of spreading extremism.
The last time Tunisia declared a state of emergency was in 2011, in the uprising which overthrew President Zine al-Abidine Ben Ali. It was lifted in March 2014.
Officials are expected to pass a counter-terrorism bill that has been in parliament since early 2014 in the coming weeks.
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…