A minor arrest in a Brooklyn nail salon spun wildly out of control Friday night — leaving a cop fighting for his life from head injuries after shooting dead a berserk T-shirt vendor who’d struck him in the face with a chair, police said.

The injured officer, a 21-year-veteran of the force whose name was not released, remained in a medically induced coma Friday night, authorities said.

The mayhem began at about 5:40 p.m. when a panhandler walked into the Goldmine nail salon on Mother Gaston Boulevard near Sutter Avenue in Brownsville and began urinating in the shop.

KANSAS OFFICER WHO KILLED MAN DURING 'SWATTING' CALL SUES CITY FOR LOST WAGES

The NYPD veteran and his rookie partner happened to be passing by in a patrol van, and were waved inside the store by disgusted workers.

But as the two cops arrested the alleged urinator — who also had an open warrant for criminal mischief — a T-shirt peddler from outside the shop burst in and confronted the officers, police said.

The peddler, identified by sources as Kwesi Ashun, 33, of Brooklyn, grabbed a chair during the struggle and swung it into the head of the veteran cop, NYPD Chief of Patrol Rodney Harrison said.

The rookie officer zapped Ashun with a Taser during the melee, but it didn’t slow his attack, police said.

So the veteran cop pulled his gun, firing at Ashun six times and hitting him at least once, in the head, authorities said.

Medics responded and rushed the injured officer to Brookdale Hospital.

Ashun was declared dead at the scene and the rookie officer was brought to Kings County Hospital to be treated for ringing in his ears.

“Once again we had police officers responding to a call for help from the public and was set upon,” Pat Lynch, head of the Patrolmen’s Benevolent Association, fumed in a press conference after the shooting.

“This police officer spent his career in our busiest precincts serving the community. And he was set upon. For no reason!” he added.

Residents of the neighborhood described the shot man as a fixture on the block, an entrepreneur who got by selling T-shirts.

State Assemblywoman Latrice Walker happened to be walking near the shop before the scene unfolded, and was even approached by the vendor for a sale.

CLICK HERE TO GET THE FOX NEWS APP

“I interacted with him moments before this took place. He asked me if I would be interested in buying the T-shirts he was selling,” Walker told The Post.

“He was always a peaceful young man,” Walker added of the man who was killed. “He was promoting a business he was trying to kick off.”

Ashun peddled T-shirts he designed and hand-embroidered himself, according to an Instagram page promoting his wares.

CLICK HERE TO KEEP READING IN THE NEW YORK POST