According to the Journal of Criminal Law and Criminology, the first documented instance of dogs used for police work dates back to the 14th Century, when the French used K-9s to protect the docks at St. Malo. They employed this tactic for hundreds of years, until a dog accidentally killed a naval officer who was out after curfew. Police dogs later appeared in Paris in the 19th Century and were used to monitor gang violence.
Though the role of police dogs has evolved over the years, it certainly has not diminished. What we would consider to be the modern role of K-9s in law enforcement began in London in the midst of the 20th Century. Dogs were trained in obedience, tracking, attack, and search. Police in those days typically used bloodhounds, who were excellent at tracking, before the trend of German shepherds began. Below, a young German shepherd gets a bit of training before he's ready to join the force.