Mexican police officers stand guard outside the Caballo Blanco (White Horse) bar, a strip club where at least 28 people died. [AFP]

Gunmen burst into a Mexican strip club in a hail of bullets and killed at least 28 people as they trapped revelers inside and started a raging fire, officials said Wednesday.

Many of the dead were dancers who worked there, according to managers.

President Andres Manuel Lopez Obrador condemned the "shameful" attack in the city of Coatzacoalcos, and said federal authorities would investigate evidence it may have stemmed from collusion between local authorities and organized crime.

The Tuesday night attack, which also left nine people badly wounded, is the latest to rock the state of Veracruz, a flashpoint in turf wars between Mexico's rival drug cartels and a hotbed of political corruption.

Survivors said gunmen sprayed bullets when they descended on the bar, the Caballo Blanco (White Horse), then blocked the exits and set the club alight.

Because of the loud reggaeton music pounding inside, many patrons and dancers did not notice the attack until the bar was in flames, they said.

Authorities said many of the victims died of smoke inhalation. It was not immediately clear whether some died of gunshot wounds.

"They arrived in several vehicles, with rifles and pistols. They threatened the security guards at the door and took control of the entrance," one survivor told an AFP reporter, speaking on condition of anonymity, as frantic relatives gathered at the bar looking for their loved ones.

Veracruz Governor Cuitlahuac Garcia tweeted that authorities had identified one of the attackers as Ricardo "N" -- Mexican law bars the release of suspects' full names -- adding that he was a repeat offender known as "La Loca" ("The Crazy One").

The suspect was previously arrested last month, but was released by state prosecutors within 48 hours, Garcia said.

President Lopez Obrador said federal authorities would investigate why.

"There's a problem there that needs to be investigated regarding the actions of the Veracruz prosecutor's office," said Lopez Obrador, a leftist elected last year on an anti-corruption platform.

"There are two things going on here: one is this shameful act by organized crime, the most inhuman thing possible; the other, which is also reprehensible, is a possible conspiracy with the authorities," he told a news conference.

The Veracruz prosecutor's office denied wrongdoing, and said in a statement it was in fact the federal prosecutor's office that released Ricardo "N."

Attackers blocked emergency exit

Veracruz is one of the most violent states in the country.

Its location on the Gulf of Mexico makes it a strategic route for drug cartels and for human traffickers bringing undocumented migrants to the United States.

Coatzacoalcos, a port city of 235,000 people, has been among those hardest hit by the resulting violence.

The governor told reporters the group that attacked the White Horse was vying for control of the drug trade there.

The interior of the bar was left wrecked and charred. The naked body of a woman who had been mid-routine was sprawled on the dance floor next to the striptease poles.

Ten of the club's 25 dancers were killed, managers said.

"My niece starting dancing here a few months ago. She was a single mom, and she wanted to give her daughter a better life and go back to school," said Maria Vazquez, whose 22-year-old niece Sugedy was among the dead.

Local media reported two sailors from the Philippines were also killed. The Philippine embassy in Mexico City said it was investigating the report.

Hit squads, corruption

Mexico, the chief supplier of narcotics to the United States, has been hit by a wave of violence since declaring war on drugs and deploying the army to fight its powerful cartels in 2006.

Since then, more than 250,000 people have been murdered, including a record 33,753 last year.

The situation in Veracruz has been particularly grim. Jailed ex-governor Javier Duarte (2010-2016) is accused of presiding over a rash of corruption and human rights abuses.

Two former state police chiefs and a string of ex-officials have been charged with running hit squads that abducted and presumably killed unwanted individuals during Duarte's administration.