A 50-year-old man was shot near the Barclays Center in Brooklyn Wednesday afternoon when an argument turned violent, according to police sources.

Victim Ellison Ingram got into an argument with two other men around 2 p.m. at the corner of Flatbush and Atlantic avenues when one of them opened fire outside the busy Atlantic Terminal mall, striking Ingram in the ankle, police and sources said.

Terrified crowds scrambled after the first shots rang out, according to eyewitness Al Bahziz.

“I’ve never been so scared in my life,” he said. “People were running and screaming. People were screaming, ‘Get down, get down.’ He could have killed a lot of people.”

Video shows the shooter arguing with someone in the moments before the attack. He looks like he’s walking away, but then he whips out a pistol and begins firing and weaving along the sidewalk.

Witnesses first feared a terror attack, another said.

“I thought it was terrorism,” said Isabel Gonzalez, 40, who sells jewelry outside the mall. “I got goosebumps. Everyone on the sidewalk ran inside. It was scary.”

Ingram was taken to Methodist Hospital in stable condition. He could be seen grimacing as he was wheeled off the scene on a stretcher.

Additional reporting by Jennifer Bain and Shawn Cohen