A man is in custody after accidentally shooting himself while trying to get away from police.

Officers were called to a funeral home on Thursday at about 8:30 p.m. after an armed man rode by the Selkirk Avenue building on a bicycle.

Police tracked the suspect to the area of Flora Avenue and McKenzie Street.

Police say the man, who still had the firearm, took off from officers.

As he was trying to get away, the man fell and the gun went off.

Officers eventually caught up with the man and he was taken to hospital to treat injuries to his upper body.

Kelsey Dale Sumner, 19, of Winnipeg, has been detained at the Provincial Remand Centre.