Tunisia lifted a state of emergency on Friday imposed nearly three months ago following a massacre at a luxury beach hotel that killed 38, mainly British tourists, the president’s office announced.

The state-run TAP news agency carried the news about the move that had been expected.

President Beji Caid Essebsi imposed the measure on July 4 for a month after the June attack at a hotel in the vacation region of Sousse — the second deadly attack on foreigners in three months. He then extended the state of emergency at the end of July for two more months — until the end of September.

The gunman behind the beach attack was killed by police and the Islamic State group later claimed responsibility for the massacre, which has dealt 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.

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

Under the state of emergency, the army, deployed to guard sensitive sites, was authorized to shoot to kill if under threat. Rallies of more than three people were banned in theory only. However, the country also armed itself with an aggressive anti-terrorism law on July 25. It was meant to aid the fight against extremist groups but has provoked fears that freedoms won in the country’s 2011 revolution might be threatened.

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

Photo Credit: An empty beach at Sousse, Tunisia. Tony Hisgett / Flickr