In the 1830s, Heinrich Essig, a dog breeder and seller and mayor of the town of Leonberg near Stuttgart in Baden-Württemberg, Germany, claimed to have created the Leonberger by crossing a female Landseer Newfoundland with a "barry" male from the Great St. Bernard Hospice and Monastery (which would later create the Saint Bernard breed). Later, according to Essig, a Pyrenean Mountain Dog was added, resulting in very large dogs with the long, white coats that were the fashion for the time, and pleasant temperament. The first dogs registered as Leonbergers were born in 1846 and had many of the prized qualities of the breeds from which they were derived. The popular legend is that it was bred to resemble the coat-of-arms animal of Leonberg, the lion. The Leonberger dog became popular with several European royal households, including Napoleon II, Empress Elisabeth of Austria, the Prince of Wales Otto Von Bismarck, Emperor Napoleon III, and Umberto I of Italy. Essig's claim of breeding the dog as described is disputed. Records from as early as 1585 may indicate the existence of Leonberger-type dogs; documents dating from 1601 held by the Metternich family describe similar dogs used to deter the theft of livestock. Either way, no doubt exists that Essig named and registered the breed first. A black-and-white engraving of the Leonberger was included in The Illustrated Book of the Dog by Vero Shaw in 1881. At the time, Essig's Leonbergers were denounced as an indifferent knockoff of a St. Bernard—not a stable and recognized breed—and a product of a popular fad or fashion for large and strong dogs, fomented in part by Essig's prodigious marketing skills (he gave dogs to the rich and famous).
The modern look of the Leonberger, with darker coats and a black masks, was developed during the latter part of the 20th century by reintroducing other breeds, such as the Newfoundland. This was necessary because breeding stocks of the Leonberger were seriously affected by the two world wars. During World War I, most Leonbergers were left to fend for themselves as breeders fled or were killed. Reportedly, only five Leonbergers survived World War I and were bred until World War II when, again, almost all Leonbergers were lost. During the two world wars, Leonbergers were used to pull the ammunition carts, a service to the breed's country that resulted in the Leonbergers' near-destruction. Leonbergers today can have their ancestry traced to the eight dogs that survived World War II.
Traditionally, Leonbergers were kept as farm dogs and were much praised for their abilities in watch and draft work. They were frequently seen pulling carts around the villages of Bavaria and surrounding districts. Around the beginning of the 20th century, Leonbergers were imported by the government of Canada for use as water rescue/lifesaving dogs. The breed continues in that role today, along with the Newfoundland, Labrador Retriever, and Golden Retriever dogs; they are used at the Italian School of Canine Lifeguard. They have been used successfully as flock guard dogs. The Leonberger received American Kennel Club recognition as a member of the Working Group on January 1, 2010, alongside the Icelandic Sheepdog and the Cane Corso. It was the 167th breed to be recognized by the AKC.