Essebsi said security had been boosted in other areas for the Muslim holy month of Ramadan, a time of Islamist violence in previous years, but that the authorities had not expected the beaches to be a target.
"It is true that we were surprised by this incident," Essebsi told France's Europe 1 radio.
"They made arrangements for the month of Ramadan, but never did they think they would need to do so on the beaches."
Essebi's comments came a day before Tunisia is to deploy 1,000 armed officers to reinforce tourism police along its Mediterranean coastline in a bid to reassure European holidaymakers and limit the damage to its tourism industry.
Also Read
Thirty-eight people were killed in Friday's attack, the majority of them British tourists.
A Tunisian identified as 23-year-old Seifeddine Rezgui pulled a Kalashnikov assault rifle from inside a beach umbrella and went on a bloody rampage on the beach and beside a hotel pool.
The gunman was eventually shot dead but there has been criticism of the length of time it took.
"If there were failings, disciplinary action will be taken immediately," Essebsi said.