Habib Essid told national television that the foreigners included tourists from Poland, Italy, Germany and Spain.
He said that two of the attackers were killed in a gunfight with police today, and that security forces are hunting for two or three others believed to have been involved.
The attack was the worst in years on a tourist site in Tunisia, which is struggling to solidify its young democracy and prevent violence by Islamic extremists.