Mohamed Salad says he doesn't remember why he shot into the crowded Ten X nightclub, injuring one of the patrons, because he was drunk and high on ecstasy at the time.

Salad, 30, pleaded guilty to two charges of recklessly discharging a firearm on Monday, just two weeks before the trial was set to begin.

Mohamed Elmi, who faced the same charges as Salad in connection with the shooting, will be released from custody after his charges were stayed by prosecutor Carla MacPhail.

"He's relieved," said defence lawyer Tonii Roulston. "It's unfortunate that this decision wasn't made earlier; however, often times these decisions are made on the eve of trial.

"It is unfortunate that Mr. Elmi spent over nine months in custody awaiting his trial date."

Roulston's position all along has been that Elmi had no knowledge that his friend planned to shoot into the club that night.

Elmi and Salad were charged after the Jan. 10 shooting on 10th Avenue S.W. that sent Kenneth Duru, 38, to hospital with a gunshot wound to his torso.

Victim suffered 'permanent injury'

Elmi, Salad and several other friends had been partying at the club when they left around 1:30 a.m. But just minutes later they pulled up in a white Ford Fusion and Salad got out, walked to the doors of the club where there were about 300 people inside and opened fire — shooting three times before a bouncer tackled him.

"The scene both in and outside of Ten X was chaotic as numerous police entered with weapons including loaded handguns and long guns in order to look for victims or more shooters," according to an agreed statement of facts.

A screenshot from CCTV footage that surfaced online of the shooting at TenX nightclub in Calgary on Jan. 11, 2016. (YouTube/Screenshot)

On the dance floor, officers found Duru who was being helped by a student nurse, and another patron who had been grazed by a bullet. A third bullet travelled between two women who had been standing facing each other.

Duru was shot in the stomach damaging his liver, gallbladder and colon as well as breaking a rib. He lost a kidney as a result and had to undergo two surgeries.

"He suffered significant pain and discomfort, as well as permanent injury," according to the facts.

'The struggle was quick and physical'

As Salad was shooting into the club, bouncer Ziad Chehede reacted "almost immediately" grabbing for the gun and pushing Salad out of the doorway and onto the Ford. During that struggle, the gun went off again, piercing through Chehede's jacket and shattering the key fob inside his pocket.

"The struggle was quick and physical," according to an agreed statement of facts read aloud in court on Monday.

Members of Calgary police's guns and gangs unit — who happened to be nearby — were quickly on scene and arrested the driver of the vehicle.

The handgun used was a semi-automatic pistol with its serial number scratched off and is considered to be a restricted firearm.

MacPhail and defence lawyer Hersh Wolch will ask Provincial Court Judge Bob Wilkins to impose a seven-year prison sentence at a hearing set for Oct. 20.

Nine other charges, including two of attempted murder, will be withdrawn at the sentencing hearing.