Tunisia’s Prime Minister Habib Essid has announced a clampdown on security after an attack on a holiday resort in which 38 people were killed.
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.
Authorities say most of the victims in Friday’s attack near Sousse were Britons. The gunman was shot dead.
Officials say he was a student not previously known to authorities.
Five Britons were confirmed dead and the Foreign Office warned the death toll could rise.
Tunisians, Germans, Belgians, French and at least one Irish citizen were also among those killed in the attack, which was claimed by Islamic State (IS). Thirty-six people are injured, officials say.
It was the second major attack on tourists in Tunisia since March, when militants killed 22 people, mainly foreigners, at Bardo museum in Tunis.
Speaking at a news conference in Tunis, Mr Essid said some mosques outside government control were spreading “their propaganda and their venom to promote terrorism” and would be shut down.
Mr Essid also vowed to act against parties and groups “acting outside the constitution” – such action could range from a warning to closure.
He said army reservists would be deployed at sensitive sites to ensure such attacks could not happen again.
‘He took a bullet for me’
One survivor told how her fiance, a Welsh tourist, was shot three times as he used his body as a shield to protect her.
“He took a bullet for me,” said Saera Wilson. “I owe him my life because he threw himself in front of me when the shooting started.
“It was the bravest thing I’ve ever known. But I just had to leave him under the sunbed because the shooting just kept on coming.
“I ran back, past bodies on the beach to reach our hotel. It was chaos – there was a body in the hotel pool and it was just full of blood.
“The country is under threat; the government is under threat,” Mr Essid said.
“Without the co-operation of everyone and a show of unity, we cannot win this war. We have won some battles and lost others, but our objective is to win the war”.
However, many Tunisians are asking why stricter security measures had not already been put in place following the attack on the Bardo museum, says the BBC’s Jim Muir in Tunis.
Security officials said the attacker, who had posed as a swimmer but was carrying a rifle under a parasol, started shooting on the beach before entering the Hotel Imperial Marhaba, continuing to shoot.
A British holidaymaker, Steve Johnson, told the BBC: “We were just lying on the beach as usual and… we heard what we thought at first was fireworks.
“But it was soon pretty obvious… that it was firearms that were being discharged and people were screaming and starting to run.”
IS said it was behind Friday’s attack on what it called a “den of vice”.
It identified the gunman by the pseudonym of Abu Yahya al-Qayrawani. Social media accounts close to the group showed pictures of him.
At the scene: Rana Jawad, BBC News, Port El Kantaoui
Tourists gathered in the lobby of the Imperial Marhaba consoling each other. Most were thankful they had survived and described a day where they faced their worst fears: not seeing their children again back home or losing a loved one before their eyes.
A woman sat in alone in a corner silently crying with her packed luggage sitting beside her. So many here were frustrated at having to stay at the scene of the attack tonight.
These are sobering times, but the people of Sousse remain defiant: they are socialising with friends and family, and large parts of the city are still lit up on what is arguably its darkest day yet.
Local media reported a second suspected attacker had been arrested, but this has not been confirmed.
IS had urged followers to step up assaults during the holy Muslim month of Ramadan.
The UK Foreign Office said the British embassy in Tunis was sending a crisis team to the area.
“Any British nationals in these hotels or nearby should remain indoors, and contact their tour operator and the Foreign Office,” the FCO said in its updated travel advice.
Many of the tourists in hotels affected by the attack left the country overnight, with tour operators arranging special flights to take them home.
Friday’s attack was the deadliest in Tunisia’s recent history. The country has seen militant Islamists gain strength since the overthrow of long-serving ruler Zine al-Abidine Ben Ali in in 2011.
Democratic elections after Ben Ali’s removal saw the moderate Islamist Ennahda party take power before the secularist Nidaa Tounes government won a parliamentary poll in October.
However, neither party has been able effectively to combat Islamist violence – which has been made worse by conflict in neighbouring Libya and by Tunisian fighters returning home after joining Islamist campaigns in Iraq and Syria.
Day of attacks
The shooting in Tunisia came on the same day as:
- A man was decapitated and several others injured at a factory in France
- A deadly attack on a Shia mosque in Kuwait
Share your pictures with us, email , upload them here, or tweet @BBC_HaveYourSay.
You could also send us pictures on WhatsApp. Our number is: +44 7525 900971.
Read our terms and conditions.