A Spanish dancer was killed when an exploding stage firework struck her during a town festival Sunday, authorities said.

Joana Sainz, 30, was performing with her 15-member group, Super Hollywood Orchestra, in the small town of Las Berlanas about 80 miles northwest of Madrid when a pyrotechnic fired shards of its metal casing into her stomach, reports said.

“Nobody can explain it,” group promoter Isidoro López told the local news agency Avila Red. “We have been doing the same [act] for five years.”

He said the fireworks are like sparklers and supposed to last 15 to 20 seconds to “give a little show,’’ according to severalnews outlets.

In this case, the manufacturer may have accidentally filled one of the sparklers with the wrong material, causing the device’s metal casing to explode, López said.

Footage of the incident showed Sainz and other group members on the stage before the explosion abruptly ended the performance.

Sainz, the group’s principal dancer and chief choreographer, collapsed to the floor as her colleagues rushed to her side. A doctor and four nurses who were in the audience ran to try to help her, too.

Sainz was rushed to a hospital, where she died of her injuries.

“A night started [with] partying and ended up in a terrible tragedy,” wrote a fan who posted a clip on Facebook of the incident.

About 1,000 people had gathered for the closing of the festival, which had to be moved to behind the town square because it had grown so popular.

The tragedy occurred at around 2 a.m., authorities said.

The town of Las Berlanas posted a tribute to Sainz on its Facebook page.

“We want to pay our condolences to the family of Joana . . . of the Super Hollywood group who yesterday passed away, as well as to her group members.

“R.I.P Johana Sainz. You are in our memory.”