Tunisia's president says before attack, new security measures had been set for July 1

A hooded Tunisian police officer stands guard ahead of the visit of top security officials of Britain, France, Germany and Belgium at the scene of Friday's shooting attack in front of the Imperial Marhaba hotel in the Mediterranean resort of Sousse, Tunisa, Monday, June 29, 2015. The top security officials of Britain, France, Germany and Belgium are paying homage to the people killed in the terrorist attack on Friday. (AP Photo/Abdeljalil Bounhar) (The Associated Press)

Tunisian police officers guard Imperial Marhaba hotel during visit of top security officials of Britain, France, Germany and Belgium in Sousse, Tunisia, Monday, June 29, 2015. British Home Secretary Theresa May, French Interior Minister Bernard Cazeneuve, German Interior Minister Thomas de Maiziere and Belgian Interior Minister Jan Jambon joined their Tunisian counterpart on the beach in front of the Imperial Marhaba hotel in the Mediterranean resort of Sousse for the tribute Monday. (AP Photo/Darko Vojinovic) (The Associated Press)

Tunisia's health minister Said Aidi, center left, and British Minister for North Africa Tobias Ellwood, center right, leave from morgue with bodies of several tourists in a local hospital in Tunis, Tunisia, Tuesday, June 30, 2015. Thirty-eight tourists died in a gun attack just days before Tunisia planned to implement heightened security measures for the Muslim fasting month of Ramadan, but those plans had not anticipated an assault on tourist beaches, the country's president said Tuesday. (AP Photo/Darko Vojinovic) (The Associated Press)

Tunisia's president says that a system of heightened security for the fasting month of Ramadan had been set to be in implemented on July 1, before the beach attack that killed 38 tourists.

In an interview with Europe 1 radio on Tuesday, Beji Caid Essebsi said the security plan had been ready, but just not yet in place when a lone gunman attacked a beach resort on Friday.

"It's true, we were surprised by the affair," said Essebsi, who was elected on promises to return security to the country. "The system of protection was set to start on July 1."

Police killed the gunman after his rampage and seven of his suspected accomplices have been arrested.

Essebsi said an inquiry had been opened into any security failures.