A man who was selling T-shirts in front of a nail salon in Brooklyn was shot dead by police inside the shop after he struck a cop in the face with a chair Friday, police sources said.

The violence broke out inside the shop on Mother Gaston Boulevard near Sutter Avenue in Brownsville around 5:40 p.m., sources said.

At the time, uniformed cops from the 73rd Precinct were inside the shop processing a public urination summons for another man.

For reasons that are not clear, the T-shirt vendor hit the cop who was writing the summons across the face with a chair, sources said.

The partner of that cop then fired off at least one shot, fatally striking the vendor, according to sources.

The officer who was struck by the chair was taken to Brookdale Hospital with facial injuries, while the cop who fired the shot was also taken to the hospital for treatment of ringing in his ears, sources said.

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

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

“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.”

Witness Chris Levine, 18, said the shot man “was screaming for help” inside the shop.

“I saw the cop chase the male inside the nail salon. When he ran inside the male threw the chair,” Levine said. “It happened so fast.”