Tunisia's president has said the country is "not safe" from further extremist attacks and has declared a national state of emergency to avoid what he says is a risk of collapse.

President Beji Caid Essebsi's speech came just over a week after a gunman at the popular beach resort of Sousse attacked foreign tourists, killing 38 people.

Mr Essebsi said the state of emergency would last 30 days.

Tunisia was previously under a state of emergency from January 2011, at the outbreak of the Arab Spring, until March 2014.

It initially included a curfew and a ban on meetings of more than three people. Although those measures were relaxed, police and the military retained powers to intervene in unrest or for security reasons.

Mr Essebsi said an "exceptional situation required exceptional measures" but pledged to respect freedom of expression.

"Tunisia faces a very serious danger and it should take any possible measures to maintain security and safety," he said. "As we see in other countries, if attacks like Sousse happen again, the country will collapse."

Mr Essebsi blamed the poor security in Libya for Tunisia's problems, and the lack of international resolve in targeting the Islamic State group throughout the region. He said Tunisia specifically had been a target of the extremist group because it had a functioning, secular democracy.

The gunman behind the beach attack was killed by police and IS later claimed responsibility for the massacre, a blow to Tunisia's tourism industry. Thirty of the 38 dead in the attack were British tourists.

In March, gunmen killed 22 people, again mostly tourists, at the National Bardo Museum outside Tunis.

Tunisia's government has promised new laws to increase police powers and provide for harsher penalties for terrorism convictions. Immediately after the Sousse attack, the prime minister pledged to post armed guards at tourist sites and close mosques outside government control.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.