Tunisia's president has declared a state of emergency more than a week after a beach attack targeting foreign tourists that killed 38 people.

The state news agency said President Beji Caid Essebsi would address the nation later after declaring the state of emergency more than a week after the attack in the resort of Sousse. Thirty of the 38 dead were British tourists.

The gunman was killed by police and the Islamic State group claimed responsibility for the massacre, a blow to Tunisia's budding democracy and tourism industry.

Tunisia's government has promised new laws to increase police powers and provide for harsher penalties for terrorism convictions.

Immediately after the attack, the prime minister pledged to post armed guards at tourist sites and close mosques outside government control.