Pergola, a restaurant and hookah lounge where a fight began that led to a shootout, has operated without proper certification from the city since July of 2014. View Full Caption Facebook/Pergola

FLATIRON — The city has allowed a Flatiron restaurant and hookah lounge where a fight between two groups led to a sidewalk shootout in November to continue to operate, despite the fact that it hasn't had a legally-required permit for the last year and a half.

Department of Buildings inspectors slapped Pergola NYC, at 36 W. 28th St., with a violation on Nov. 23 for failing to renew its certificate of occupancy, which it needs in order to legally use the space as a "eating and drinking establishment." The last certificate of occupancy issued for the building was a temporary one that expired in July 2014, records show.

But the lounge was allowed to remain open for business because inspectors did not find any immediately hazardous conditions in the building, a Department of Buildings spokesman said Tuesday.

Pergola submitted an application for a new permit on Monday, days after DNAinfo reached out to the lounge regarding the issue, DOB records show.

The inspection came less than a week after a Nov. 17 shooting on the block that injured a bystander and stemmed from a dispute that began inside Pergola.

The fight erupted when two groups traded insults inside the bar, and as the adversaries left Pergola just before 2 a.m. the argument turned violent, police said.

Surveillance footage from the scene showed two men, later identified as Ronald McPhatter, 32, and Gadell Gibbs, 33, both of Brooklyn, approaching another man, later identified as Charles Dunwoody, 37, of Corona, and opening fire on him, according to police. Dunwoody allegedly fired back before all three fled, officials said.

In the mayhem a stray bullet hit a 21-year-old woman standing on the corner of West 28th Street and Sixth Avenue, police said. Medics transported the woman to Bellevue Hospital Center, where she was treated for minor injuries, police said.

Dunwoody turned himself in a day after the shooting and was charged with weapons possession and assault. He was released after paying $50,000 bail, according to court records.

Police apprehended McPhatter and Gibbs on Nov. 25, a week after Dunwoody's arrest, according to authorities.

Prosecutors hit McPhatter with a felony assault charge and are seeking attempted murder charges against Gibbs, the most serious charges against anyone implicated in the shooting, court records show.

McPhatter is being held on $75,000 bail and Gibbs is being held on $100,000 bail, records show. Both men are due back in court on Jan. 13, and Dunwoody is due back in court on Jan. 20.

Representatives of Pergola did not respond to requests for comment.

The Nov. 17 shootout took place a month after a fatal shooting outside another Flatiron club, Motivo, in which a 24-year-old single mom died and two other women were wounded.