Two people are in custody in connection with a shooting in The Annex on Monday night, Toronto police confirm.

Gunshots rang out in the area of Madison and Bernard avenues at around 9:30 p.m.

Paramedics located a 22-year-old man in the area suffering from serious gunshot wounds. He was taken to a trauma centre for treatment and is now believed to be in non-life-threatening condition.

Investigators say that prior to the shooting, the victim and two friends, a 23-year-old man and a 21-year-old woman met with an unknown male in an alley behind Bernard Street.

After the 22-year-old was shot, all three got into a red sedan and sped off.

Police say they struck a male pedestrian around the corner from where the shooting occurred and then later hit a tree.

The pedestrian was taken to hospital for treatment and his injuries are also not believed to be life-threatening.

One male and one female were taken into custody in connection with the shooting. Police have not said what charges they are facing.

Investigators allegedly located a firearm at the scene of the shooting.

Police identified the pair as 23-year-old Jermaine Hall of Richmond Hill and 21-year-old Drucella Oduro, also of Richmond Hill.

Each was charged with five offences including careless storage of a firearm and possession of a firearm obtained by crime.

Both appeared in court at College Park on Tuesday afternoon.

The suspect in the shooting is still outstanding and may have fled the scene in a white sedan.