A man was shot in a downtown alley Saturday after a police officer was attacked.

The shooting happened about 11 a.m. at Centre Street and 7th Avenue after an anti-racism rally at city hall.

Police say a man, who is known to them, stopped at the rally and created a disturbance.

The man left the area, but was followed by an officer, who then approached the man.

Police say the man pulled out a metal pipe and attacked the officer, who then used his baton, pulled out his gun and shot the man.

During the scuffle, the officer put out a distress call, saying he was in danger.

Calgary Police Chief Paul Cook says an officer in distress is a priority.

“A code 200 is a major code that we use. It is probably one of the most significant coded that an officer would call out over the period and essentially there is no higher priority call, it is an officer that is in immediate distress and needs assistance,” said Cook.

ASIRT, the Alberta Serious Incident Response Team, is investigating the shooting.

Susan Hughson with ASIRT says they are looking for witnesses.

“The dynamics of what exactly occurred in that alleyway are very important to determining what happened and determining how appropriate the use of force was. It’s a location where there are hotels, it’s a public area so we’re hoping to get the best picture possible of what happened in that alley from as many perspectives as possible,” said Hughson

The man was taken to hospital where he remains in critical condition.

One officer sustained injuries and was treated on scene.

This is the second time in a week Calgary police have been involved in a shooting.

On Monday, March 20th, an officer shot and killed a man in a hotel room after being threatened with a needle.

ASIRT investigates all incidents involving law enforcement.