After spending 10 days in custody, a 17-year-old charged with second-degree murder was on the verge of being granted bail.

The teen was sitting beside his defence lawyer, Ajay Juneja, last Thursday afternoon before Youth Court Judge Aran Veylan.

Suddenly the unthinkable happened.

"Without warning, without expectation, without any kind of a prelude, a man attacked my client from behind," Juneja said. "He lunged. Within a matter of a second, he was able to get from where he was seated to between me and my client."

The man — the murder victim's father — put his hand on the teen's shoulder, Juneja said.

Lawyer describes how the father of a murder victim tried to attack his client in court. 1:04

"That man was clearly intent on hurting my client," he added.

He never got the chance.

Just as quickly, a sheriff positioned at the back of courtroom 442 ran toward the attacker and tackled him to the ground.

Juneja was amazed.

"It was like an NFL game watching the officer tackle this man from behind and push him forward," the lawyer recalled.

Father of homicide victim charged

The accused killer cannot be identified under the Youth Criminal Justice Act. On May 9, he turned himself in to police and was charged with the second-degree murder of Joshua Barnes.

Barnes, 18, and another man were found lying in a parking lot at 125th Street and 132nd Avenue in June 2017. Barnes died of a stab wound, and the other man was sent to hospital with non-life-threatening injuries.

The accused is also charged with two counts of robbery using a prohibited firearm and aggravated assault in relation to the second victim who was injured.

The body of Joshua Barnes and another injured male were found in this parking lot near 125th Street and 132nd Avenue in June 2017. (Scott Neufeld/CBC News )

The Thursday court hearing was the first time that Barnes' father had laid eyes on the young man accused of killing his son.

Kenneth Many Shots, 41, is charged with one count of uttering threats to cause death or bodily harm.

After the sheriffs handcuffed Many Shots, Juneja said, the grieving father "went on a tirade."

"He was ranting on the fact that he now knew where my client lived. He responded with threats to the family. Indicated he would strangle my client, slit his throat. That my client really messed up. He indicated that his son's life was now gone. The man continually said, 'Kid, you're dead.'"

Sheriffs suffered minor injuries

Both sheriffs involved with tackling and restraining Many Shots suffered soft-tissue injuries, according to a spokesperson for Alberta Justice and Solicitor General.They are still off the job, and are expected to return to work in June.

"Our sheriffs at the courthouse did a commendable job — first by anticipating that the situation was escalating, and then by quickly intervening before anyone was seriously hurt," Sherene Khaw said in an email to CBC News.

Khaw credited their response to the 14 weeks of training received by all sheriffs. The training includes restraint and control techniques.

The defence lawyer also praised the fast response by sheriffs.

"If it wasn't for their extreme diligence and their alertness, I think this could have been a much more serious situation," Juneja said.

Joshua Barnes, 18, was stabbed to death in June 2017. (Facebook )

"In 18 years of representing people in these courts, I don't think I've experienced anything quite like it. It happened so quickly. It was shocking."

Many Shots spent one night in custody before being released on $2,000 bail. He has also been ordered to stay away from the young man accused of murdering his son.

The 17-year old was ultimately granted bail last Thursday. Juneja is worried about his safety.

"I have alerted the RCMP in his local jurisdiction," Juneja said. "I believe the family will be changing their address. Other than that, there's really not much that can be done."