The students were eating dinner in Tlemcen, 520 kilometres (320 miles) southwest of the capital Algiers when the explosion occurred. The head of the area's university works department said that gas had accumulated in the basement of the building following a leak.
The local emergency services said the toll could rise.