Investigators have determined that a man who sustained a gunshot wound in Rexdale on Thursday night accidentally shot himself with a weapon that he had attempted to conceal after shooting at a crowd of people nearby.

Police say the suspect was armed with a double-barreled sawed-off shotgun when he entered a Toronto Community Housing courtyard near Finch Avenue and Albion Road with another man, who was armed with a handgun.

Once in the courtyard, police say that both men began shooting in the direction of people who were gathered nearby.

The man with the shogun fired at least one round while the man with the handgun fired at least 10 rounds, police say.

Both men then fled the scene onto Kendleton Avenue.

That’s when police say the man with the shotgun accidently discharged a round into his leg while trying to conceal the weapon.

The man was rushed to hospital to receive treatment for the gunshot wound. He was then arrested at the hospital on Friday morning.

Ojo Oluwaseun, 19, of Toronto, is facing a total of 13 charges, including discharging a firearm in a reckless manner, possession of a firearm obtained by crime and common nuisance.

Police continue to search for the second man.

He is described as black, in his 20s and five-foot-ten to six-feet-tall. He was last seen wearing grey pants and a black hooded top with a white logo on the front.