He said army reservists would be deployed to archaeological sites and resorts. About 80 mosques accused of “spreading venom” will close within a week, he said.
Fifteen of the victims in Friday’s attack near Sousse were Britons. The gunman was shot dead.
He was identified as Seifeddine Rezgui, a student not previously known to authorities, officials said.
One Belgian and one German have so far been identified among the dead, the health ministry said. One citizen of the Irish Republic is also confirmed dead.
There were also thought to be Tunisians and French killed in the attack, which was claimed by Islamic State (IS). At least 36 people are injured, some seriously.
It was the second major attack on tourists in Tunisia since March, when militants killed 22 people, mainly foreigners, at Bardo museum in Tunis.
Many of the tourists in hotels affected by Friday’s attack have left the country or are waiting for specially arranged flights, but correspondents noted a few were back by the hotel pool on Saturday, vowing they would continue their holidays as scheduled.
Speaking at a news conference in Tunis, Mr Essid said some mosques outside government control were spreading “venom” and would be shut down.
Mr Essid also vowed to act against parties and groups “acting outside the constitution”.
“The country is under threat; the government is under threat,” Mr Essid said.