Flames raced through a crowded nightclub in southern Brazil, killing more than 230 people, stampeding toward a single exit partially blocked by those already dead.
It appeared to be the world's deadliest nightclub fire in more than a decade.
Witnesses said a flare or firework lit by band members may have started the blaze in Santa Maria, a major university city of about 225,000 people.
Television images showed smoke pouring out of the Kiss nightclub as shirtless young men who had attended a university party joined firefighters using axes and sledgehammers to pound at windows and walls to free those trapped inside.
Guido Pedroso Melo, commander of the city's fire department, told the O Globo newspaper that firefighters had a hard time getting inside the club because ''there was a barrier of bodies blocking the entrance.''
Teenagers sprinted from the scene desperately seeking help. Others carried injured and burned friends away in their arms.
''There was so much smoke and fire, it was complete panic, and it took a long time for people to get out, there were so many dead,'' survivor Luana Santos Silva told the Globo TV network.
The fire spread so fast inside the packed club that firefighters and ambulances could do little to stop it, Silva said.
Another survivor, Michele Pereira, told the Folha de S. Paulo newspaper that she was near the stage when members of the band lit flares that started the conflagration.
''The band that was onstage began to use flares and, suddenly, they stopped the show and pointed them upward,'' she said. ''At that point, the ceiling caught fire. It was really weak, but in a matter of seconds it spread.''
Guitarist Rodrigo Martins told Radio Gaucha that the band, Gurizada Fandangueira, started playing at 2.15am (5pm NZT) ''and we had played around five songs when I looked up and noticed the roof was burning''.
''It might have happened because of the Sputnik, the machine we use to create a luminous effect with sparks. It's harmless, we never had any trouble with it.''
When the fire started, a guard passed us a fire extinguisher, the singer tried to use it but it wasn't working.''
He confirmed that accordion player Danilo Jacques, 28, died, while the five other members made it out safely.
Police Major Cleberson Braida Bastianello said by telephone that the toll had risen to 233 with the death of a hospitalised victim. Officials counted 232 bodies that had been brought for identification to a gymnasium in Santa Maria, which is located at the southern tip of Brazil, near the borders with Argentina and Uruguay.
An earlier count put the number of dead at 245.
Federal Health Minister Alexandre Padhilha told a news conference that most of the 117 people treated in hospitals had been poisoned by gases they breathed during the fire. Only a few suffered serious burns, he said.
Brazil President Dilma Rousseff arrived to visit the injured after cutting short her trip to a Latin American-European summit in Chile.''It is a tragedy for all of us,'' Roussef said.
Most of the dead apparently suffocated, according to Dr. Paulo Afonso Beltrame, a professor at the medical school of the Federal University of Santa Maria who went to the city's Caridade Hospital to help victims.
Beltrame said he was told the club had been filled far beyond its capacity during a party for students at the university's agronomy department.
Survivors, police and firefighters gave the same account of a band member setting the ceiling's soundproofing ablaze, he said.
''Large amounts of toxic smoke quickly filled the room, and I would say that at least 90 per cent of the victims died of asphyxiation,'' Beltrame said.
''The toxic smoke made people lose their sense of direction so they were unable to find their way to the exit. At least 50 bodies were found inside a bathroom. Apparently they confused the bathroom door with the exit door.''
In the hospital, the doctor ''saw desperate friends and relatives walking and running down the corridors looking for information,'' he said, calling it ''one of the saddest scenes I have ever witnessed''.
Rodrigo Moura, identified by the newspaper Diario de Santa Maria as a security guard at the club, said it was at its maximum capacity of between 1000 and 2000, and partygoers were pushing and shoving to escape.
Santa Maria Mayor Cezar Schirmer declared a 30-day mourning period, and Tarso Genro, the governor of the southern state of Rio Grande do Sul, said officials were investigating the cause of the disaster.
The blaze was the deadliest in Brazil since at least 1961, when a fire that swept through a circus killed 503 people in Niteroi, Rio de Janeiro.
Sunday's fire also appeared to be the worst at a nightclub since December 2000, when a welding accident reportedly set off a fire at a club in Luoyang, China, killing 309.
In 2004, at least 194 people died in a fire at an overcrowded nightclub in Buenos Aires, Argentina. Seven members of a band were sentenced to prison for starting the flames.
Several years later, in December 2009, a blaze at the Lame Horse nightclub in Perm, Russia, killed 152 people after an indoor fireworks display ignited a plastic ceiling decorated with branches.
Similar circumstances led to a 2003 nightclub fire that killed 100 people in the United States. Pyrotechnics used as a stage prop by the 1980s rock band Great White set ablaze cheap soundproofing foam on the walls and ceiling of a Rhode Island music venue.
The band performing in Santa Maria, Gurizada Fandangueira, plays a driving mixture of local Brazilian country music styles. Guitarist Martin told Radio Gaucha the musicians are already seeing hostile messages.
''People on the social networks are saying we have to pay for what happened,'' he said. ''I'm afraid there could be retaliation''.