A man armed with an untraceable “ghost gun” shot four men during a fight that spilled out of a Manhattan bar early Monday — before he was shot and wounded by an NYPD sergeant, police said.

The uniformed sergeant and an officer pulled up to 11:11 Restaurant & Lounge on 10th Ave. near W. 211th St. about 4 a.m. to try to quell a noisy argument among patrons, according to NYPD Chief of Patrol Juanita Holmes.

An argument inside the bar had spilled outside at closing time, with bar security trying to diffuse the tensions.

The gunman, part of a group that had moved about eight feet away while police were speaking to security, opened fire, hitting four victims, cops said.

The sergeant took cover behind a utility pole and fired, striking the 25-year-old shooter in the hip, a police source said. It wasn’t immediately clear if the gunman fired at police during the chaotic clash.

EMS rushed the gunman to Harlem Hospital, where he was in stable condition as he underwent surgery.

The men cops say he shot, ranging in age from 28 to 35, were hospitalized with injuries not considered life-threatening, police said.

“Enjoy the best time of your life from 11PM to 4AM,” the bar boasts on its website.

Cops recovered the gunman’s weapon, an unregistered “ghost gun” with no serial number and can be bought online and assembled at home.

In August, Francisco Martinez, 38, and Maria Ovalles, 29, were accused in a Manhattan indictment of assembling eight guns from pieces they bought online.

“These defendants turned their apartment into a small-scale gun factory,” Vance said in a statement at the time. “Ghost guns are no longer an abstract, looming threat — they are here, and we need federal regulation to stop them.”

The NYPD has said that they recovered about 150 ghost guns last year, up from 48 in 2019 and only 17 in 2018.