After being stabbed in the head by a teen fleeing from authorities, Calgary police dog Jester appeared to be "distraught and confused" before his handler realized the seriousness of the German shepherd's injuries, court heard Monday at the boy's sentencing hearing.

Youth court Judge Steve Lipton released video of the stabbing taken from the Calgary Police Service's HAWCS helicopter.

The Grade 10 student can not be identified in order to comply with the Youth Criminal Justice Act. He was sentenced to three months deferred custody as proposed by prosecutor Camelia Wong — meaning if stays out of trouble, he stays out of jail — followed by nine months of probation.

After a 6.5-week recovery, Jester the Calgary police dog returned to work Tuesday evening. He was stabbed in the head multiple times during a pursuit in late July. (Calgary Police Service)

The teen, whose family was in court for the sentencing, must also complete 50 hours of community service. The judge suggested those hours involve working with animals.

When given the chance to speak in court, the boy apologized to the Calgary Police Service which had several of its K9 unit members in the courtroom.

"I apologize for my actions and to the CPS, I understand the severity of the situation."

Video shows Jester being stabbed

On July 30, 2015 when the boy was 14-years-old, he and a 15-year-old broke into Grant MacEwan School. The alarm at that school brought police to the scene.

Once there, the two boys ran from officers. The older boy was quickly arrested, but police sent Jester after the younger one.

The teen was found in a dark alley and was again told not to run but refused to give himself up. He got on a bicycle and was knocked off by Jester. That's when the boy stabbed the dog in the head.

He then hid in a yard and was surrounded by police who were then able to arrest him.

Kids in Calgary impacted by stabbing

Once Const. Jason Welz realized his service dog Jester had been injured, he rushed his dog to an emergency vet hospital. En route, Welz said he "expected the worst case scenario."

Jester needed surgery and his recovery took months.

In his victim impact statement, Welz said the police dogs have become "heroes" to kids in Calgary and that the attack "impacted children around the city."

According to reports prepared ahead of the sentencing hearing, the teen — who has no criminal record — was found to be a very low risk to reoffend.

'Stupid things teenagers engage in'

He is an excellent student who, according to Lipton made a "horrible mistake."

A mental health report found the boy is a hard working, quiet, calm and has a gentle personality. He is very close with his family, is "academically gifted" and plans to attend university, said defence lawyer Curtis Mennie.

Lipton noted the severity of the crime but noted "putting children in jail creates criminals, it does not rehabilitate," so if the boy abides by his conditions which includes a curfew, he will stay out of custody.

"I hope you've learned that what you've done," said Lipton.

The older boy involved who was 15-years-old at the time pleaded guilty to breaking into the school and received a nine month conditional discharge

Lipton said that teen's actions involved an "impulsive act; one of the many stupid things teenagers engage in before their brains fully develop" before imposing the sentence which also included a curfew and an order to attend school.