A man was shot while trying to flee a robbery attempt during an armed carjacking in Chicago’s South Loop early Tuesday morning.

Police said the 27-year-old man was walking down the street around 1:30 a.m. in the 2200 block of South Wabash when three masked men exited a Jeep Cherokee and two of them began to steal a 2006 grey BMW.

That's when witnesses say a third man turned the gun on the victim, telling him "if you run, I will shoot you."

The third man tried to rob the victim on the sidewalk and when the victim ran, he was shot in the back, police said.

Sarah Harper-Brazzle said she and friends were walking with the victim at the time. She was already running and in a nearby alley when she said she heard the gunshot.

She returned a few minutes later to find her friend on the ground.

"It was so close, you could see everything play out," she said. "It was horrible. I've never been through anything like that before."

The victim was taken to Northwestern Memorial Hospital in stable condition. The 28-year-old driver of the vehicle was not injured in the incident.

Check back for details on this developing story.