A wild bar brawl in Pittsburgh between undercover cops and reputed members of the Pagans motorcycle club ended in the arrests of four bikers, according to police.

The fight at Kopy’s Bar on South 12th Street broke out early Friday after a customer outed four narcotics detectives working undercover to investigate complaints of drug dealing, the Pittsburgh Post-Gazette reported.

“Those guys are cops,” the customer said while pointing at the detectives, prompting the six purported Pagans to stare, Detective Brian Burgunder wrote in a criminal complaint.

Realizing their cover had been blown, one detective approached the bikers and “confirmed to them that we were, in fact, police officers and we were not there to infringe on anyone’s good time,” according to the complaint.

Two of the bikers — some of whom wore Pagans vests — left the bar. The remaining four and the detectives kept an affable atmosphere at first, shaking hands multiple times, until things took a violent turn when Frank Deluca, of Greenfield, began screaming and pushing one of the detectives, police said.

Michael Zokaites, a 6-foot-3, 280-pound man from Shaler, allegedly punched Burgunder and another detective in the head and face before another detective swung back and tackled Zokaites.

Burgunder, according to the complaint, then grabbed Deluca and noticed a gun in his waistband before screaming out that the suspect had a gun. Deluca refused to comply with the detective’s demands and continued kicking and punching inside the bar, where some of the melee was caught on camera by a customer.

“I’m a cop, I’m a cop,” one detective can be heard screaming on the footage while trying to subdue the suspects. “What the f—k is wrong with you?”

At one point, a police sergeant who arrived on the scene broke out his pepper spray, hitting both the bikers and fellow officers. Deluca continued to fight back until he was ultimately subdued with several punches to the face, police said.

A gun was found in Deluca’s waistband, police said. Another man in the group, Erik Hertzrater, 28, of Hampton, also had a gun in his waistband, although both men had permits to carry concealed weapons, according to the complaint.

Bruce Thomas, 61, of Allentown, was also arrested. All four men were charged with aggravated assault, conspiracy and riot, according to the newspaper. No serious injuries were reported. Deluca was hospitalized before being taken to jail with two black eyes and significant bruising to his face, his booking photo shows.

But the executive director of the city’s Citizen Police Review Board said she has some questions about the incident and has opened an inquiry.

“The content of the video I saw raises questions as to the professional conduct of the officers involved,” Elizabeth Pittinger told the Post-Gazette.