The spokesman said the explosion occurred at about 1700 GMT during a festival in the town, which is 40 km east of the popular tourist destination of Malaga.
Video footage posted on social media showed people fleeing a fire inside a small restaurant called “La Bohemia” close to the centre of Velez-Malaga, with the street outside covered in debris.
None of those seriously injured were at risk of death, a spokesman for the local hospital said. The majority of injuries were cuts and bruises.
El Pais newspaper said a cook at the restaurant was able to alert customers to a fire in the kitchen, which gave most enough time to escape serious injury.