The 17-year-old - who is too young to be legally named - hit police dog Stark up to 20 times with a rusty machete, leaving the dog's handler fearing Stark would not survive.
The attacker appeared in Birmingham Youth Court today where he was sentenced to an eight-month detention training order for possessing a bladed weapon and causing unnecessary suffering to a service animal.
He was also ordered to pay £100 compensation for the distress he caused to Stark and handler Pc Paul Hopley.
Stark was on the trail of suspected burglars in Handsworth at 4am on November 14 when the teenager emerged from his allotment hiding place with a machete.
The court heard how Pc Hopley told the 17-year-old several times to put the weapon down but he continued to “swing the machete wildly".
Pc Hopley rugby tackled the knifeman to the floor and Stark helped detain him in the allotments off Larch Avenue.
The boy was arrested and charged days later after he’d received treatment for dog bites.
Stark suffered cuts to his face, with one blow narrowly missing an eye, but he’s made a full recovery and his policing career is now flourishing,West Midlands Police said.
On his first night shift back at work, Stark tracked down a wanted person who had tried to hide from officers on a flat roof.
The three-year-old German Shepherd / Belgian Malinois cross has now passed his firearms support dog course with flying colours and is enjoying his role supporting the firearms unit.
Pc Hopley said: “Hopefully today’s sentence sends out a clear message that it is completely unacceptable to attack a service animal.
“Although Stark appears to have made a full recovery, this is very much down to luck and he was extremely fortunate that his injuries were not more severe following the attack on him that morning."