The blast happened at around 4 p.m. local time when the restaurant was closed, Pau Ricoma, mayor of Tarragona, told reporters.
"Two people who were passing by were hurt," he told local media.
In all, seven people were injured, two seriously. All were taken to hospital, Reuters news agency reported.
"It is not clear what caused the explosion but it is almost certainly gas," Ricoma said.
The Mossos d'Escuadra, the Catalan regional police, have opened an investigation over the incident.
MA/PR