A state of emergency imposed in Tunisia after a gunman killed 38 foreign tourists in June is to be extended for two months, the president's office announced Friday.

"After consultations with the prime minister and the speaker, the president has decided to extend the state of emergency in force nationwide for two months from August 3," a statement said.

The decision was criticised by rights groups, who warned that Tunisia's new security measures were "open to abuse" by authorities.

On July 4, eight days after the shooting massacre at the Mediterranean resort of Port El Kantaoui, President Beji Caid Essebsi ordered a state of emergency for an initial 30 days.

Presidency spokesman Moez Sinaoui told AFP the state of emergency had been extended because Tunisia remained "at war against terrorism".

The decision was not the result of a specific threat "but because the causes (of its initial imposition) are still there," Sinaoui said.

The state of emergency was one of a raft of measures introduced by the authorities after the seaside massacre, which dealt a heavy blow to Tunisia's key tourism industry.

The government began arming tourism police for the first time and reinforced them with troops in a bid to reassure foreign governments.

But Britain, whose nationals accounted for 30 of the dead, warned against all but essential travel to Tunisia, saying more needed to be done to make it a safe holiday destination.

On Friday, the European Union said it was providing 116.8 million euros ($129.4 million) to Tunisia as part of annual funding aimed in part at boosting security.

"A strong and democratic Tunisia is vital for the stability of Europe," EU foreign affairs chief Federica Mogherini said in a statement.

A state of emergency, granting special powers to the police and army, was in force for three years up until March 2014, following longtime secular president Zine El Abidine Ben Ali's ouster in a 2011 revolution.

Apart from allowing the barring of strike action, the measure authorises the authorities to raid homes at any time of the day and to keep tabs on the media.

Tunisia last week passed a new anti-terror bill, which approved the imposition of the death penalty for "terrorist" crimes.

Eight advocacy groups, including Human Rights Watch, said Friday that the new law "imperils human rights", calling on parliament to implement safeguards, including an assurance that suspects have access to a lawyer from the time of arrest.