When the first sparks flew, the lead singer of Goodbye to Gravity joked that they weren't part of the heavy metal band's performance.

Moments later, flames spread quickly through the crowded basement club in downtown Bucharest, trapping many and triggering a stampede that would leave at least 27 people dead and 180 injured — making it the deadliest nightclub blaze in Romanian history.

Two of the band members were among the dead, while the lead singer was one of the many people who were treated in hospital for extensive burns. Witnesses said about 300 to 400 people, including some children attending with their parents, were at the club, housed in a former factory, when a pyrotechnical show went awry. They said there was only one exit.

A spark on stage ignited some polystyrene decor, club-goers told Digi 24 television. Photos posted on social media appeared to show a flame emanating from a pillar covered in foam insulation as those in the audience applauded the band.

The group, which was launching its new album "Mantras of War" Friday, had performed a song titled "This is the Day We Die" from their latest CD before the fire broke out, witnesses at the club said.

Hundreds of members of Bucharest's medical community were mobilized in frantic efforts to save as many lives as possible. Bogdan Oprita, a spokesman for the Floreasca Emergency Hospital, said it was the worst bloodshed since the 1989 anti-Communist revolution.

"It was like a war," he said. "Dozens of surgeons were called from home and asked to operate."

Emergency worker Violeta Maria Naca, with 22 years of experience, described in a Facebook post how parents were kissing ambulances carrying their children, while others were hitting the vehicles begging to be transported to hospital.

"There was a child with 70 percent burns. I was crying. The flesh was coming off him. He was asking whether he would live. If it was serious," she wrote. "He was almost in a coma. Blood and tears were coming out of his eyes. He asked me to hold his hand. I told him I had a boy the same age."

Children accompanied by an adult are allowed to enter nightclubs in Romania and many clubs don't pay attention to the age limit of 18 for unaccompanied teenagers.

Delia Tugui, a Spanish teacher at the American International School of Bucharest who was at the concert with her husband and son, said on Saturday that club-goers were surprised by how fast the fire spread and panicked.

"The lead singer made a quick joke: 'This wasn't part of the program.' The next second, he realized it wasn't a joke and asked for a fire extinguisher," she wrote on her Facebook page. "In 30 seconds... the fire spread all over the ceiling. People rushed to the entrance but it was too narrow, and people panicked."

"Friends were looking for each other under the pile of people," she said. "It was a nightmare."

She said she knew some would not escape.

"I realized that those on the other side of the bar would not get out alive."

"I was two meters (6.6-feet) from the door and I barely got out," she told The Associated Press. Then there was a blast and her hair caught fire.

"I tried to put it out with my hands and got burned. People behind me were burned from head to toe," she said. "Other people were hairless, their clothes were half-burned, and skin burned."

Several major nightclub fires have been blamed on pyrotechnics igniting foam used for soundproofing, including The Station nightclub fire in the U.S. that killed 100 people in West Warwick, Rhode Island, in 2003 and the Kiss nightclub fire in Brazil, which killed 242 people in the university town of Santa Maria in 2013.

Goodbye to Gravity's guitarists Vlad Telea and Mihai Alexandru were among the 27 dead, Mediafax news agency reported, citing the band's record label Universal Music Romania. Lead singer Andrei Galut has serious burns, and bassist Alex Pascu and one other band member were also hospitalized with serious injuries.

An Italian woman, two Spanish citizens and a German man were among the injured, the Romanian Intelligence Agency said.

Prime Minister Victor Ponta cut short a visit to Mexico to return to Bucharest and declared three days of mourning for the victims starting immediately.

About 20 clubs in Bucharest announced they were canceling Halloween parties scheduled for Saturday evening out of respect for the victims of the fire while one club said it would donate the evening's takings to the victims of the fire.

President Klaus Iohannis visited injured people Saturday at the Floreasca hospital in Bucharest and tried to comfort survivors and relatives. He said most of the injured were unconscious and in serious condition. He later visited the nightclub and spent a few moments paying silent respect to the victims.

The nightclub is one of dozens of clubs and bars that have sprung up in the Romanian capital in recent years, a lively city of 3 million renowned for its nightlife and long hours.

Shooting candles and indoor fireworks are common in bars and restaurants in Romania and fire regulations can be lax.

The General Prosecutor's office said that five of the dead had still to be identified. The interior ministry, which set up seven lines for families to call to find out about victims, said it had received more than 1,000 calls.

General Prosecutor Tiberiu Nitu said prosecutors are probing what happened. Police spent all night in the club investigating the incident and questioning the club's owners.

Iohannis also promised an inquiry into the blaze to prevent future disasters.

"I visited burns patients from last night's tragedy," he said. "I spoke to a patient's mum. People are disgusted that such a thing could happen and I hope we manage to have results of the inquiry as soon as possible and to change norms so that things like this never happen again."