Four men were wounded early Thursday when a gunman opened fire during a performance at a crowded music club in Manhattan.

The shooting followed a dispute between groups around the stage, according to witnesses and the police.

The gunfire erupted around 12:10 a.m. before the headlining artist, Fat Trel, had begun performing at the club, S.O.B.’s, on the corner of Varick and Houston Streets in SoHo.

The four men, who were hit by at least six bullets, ranged in age from 26 to 33. They were all shot in the legs and were all expected to survive. The police said the 33-year-old, who was not identified, appeared to have been the intended target. He was shot three times.