Dogs in warfare have a very long history starting in ancient times. From being trained in combat, to their use as scouts, sentries, messengers, mercy dogs, and trackers, their uses have been varied and some continue to exist in modern military usage.
War dogs were used by the Egyptians, Greeks, Persians, Sarmatians, Baganda, Alans, Slavs, Britons, and Romans.
Among the Greeks and Romans, dogs served most often as sentries or patrols, though they were sometimes taken into battle. The earliest use of war dogs in a battle recorded in classical sources was by Alyattes of Lydia against the Cimmerians around 600 BC. The Lydian dogs killed some invaders and routed others. At the Battle of Pelusium (525 BC), Cambyses II deployed dogs, cats, and other animals held sacred by the Egyptians. By putting these animals in the front lines, he was supposedly able to get the Egyptians to cease using their projectile weaponry.
During the Late Antiquity, Attila the Hun used large war dogs in his campaigns. Gifts of war dog breeding stock between European royalty were seen as suitable tokens for exchange throughout the Middle Ages. Other civilizations used armored dogs to defend caravans or attack enemies.
In the Far East, Vietnamese Emperor Lê Lợi raised a pack of 100 hounds, tended and trained by Nguyễn Xí, whose skills were impressive enough to promote him to the commander of a shock troop regiment.
Later on, Frederick the Great of Prussia used dogs as messengers during the Seven Years' War with Russia. Napoleon also used dogs during his campaigns. Dogs were used until 1770 to guard naval installations in France.
The first official use of dogs for military purposes in the U.S. was during the Seminole Wars. Hounds were used in the American Civil War to protect, send messages, and guard prisoners. General Grant recounts how packs of Southern bloodhounds were destroyed by Union troops wherever found due to them being trained to hunt runaway slaves before the war. Dogs were also used as mascots in American WWI propaganda and recruiting posters.
Dogs have been used in warfare by many civilizations. As warfare has progressed, their purposes have changed greatly.
Dogs have been used for many different purposes. Different breeds were used for different tasks, but always met the demands of the handlers. Many roles for dogs in war are obsolete and no longer practiced, but the concept of the war dog still remains alive and well in modern warfare.
Main article: Attack dog
In ancient times, dogs, often large mastiff-type breeds, would be strapped with armor or spiked collars and sent into battle to attack the enemy. This strategy was used by various civilizations, such as the Romans and the Greeks. While not as common as in previous centuries, modern militaries continue to employ dogs in an attack role. SOCOM forces of the US military still use dogs in raids for apprehending fleeing enemies or prisoners, or for searching areas too difficult or dangerous for human soldiers (such as crawl spaces).
Another program attempted during World War II was suggested by a Swiss citizen living in Santa Fe, New Mexico. William A. Prestre proposed using large dogs to kill Japanese soldiers. He convinced the military to lease an entire island in the Mississippi to house the training facilities. There, the army hoped to train as many as two million dogs. The idea was to begin island invasions with landing craft releasing thousands of dogs against the Japanese defenders, then followed up by troops as the Japanese defenders scattered in confusion. One of the biggest problems encountered was getting Japanese soldiers with whom to train the dogs, because few Japanese soldiers were being captured. Eventually, Japanese-American soldiers volunteered for the training. Another large problem was with the dogs; either they were too docile, did not properly respond to their beach-crossing training, or were terrified by shellfire. After millions of dollars were spent with inconclusive results, the program was abandoned.
The Soviet Union used dogs for antitank purposes beginning in the 1930s. Earlier antitank dogs were fitted with tilt-rod mines and trained to run beneath enemy tanks, which would detonate the mines automatically. However, the dogs were trained with stationary Russian tanks and very seldom ran under the moving tanks; instead, they were shot as they ran beside the moving tanks. When both Russian and German tanks were present, the dogs would preferentially run towards the familiar Russian tanks.
About the time World War I broke out, many European communities used dogs to pull small carts for milk deliveries and similar purposes. Several European armies adapted the process for military use. In August 1914, the Belgian Army used dogs to pull their Maxim guns on wheeled carriages and supplies or reportedly even wounded in their carts. Two dogs of the sturdy and docile Martin Belge breed were used to pull each machine gun or ammunition cart. Already in common civilian use and cheap to buy and feed, the dogs proved hardier and more suitable for military use under fire than packhorses. The dogs were officially withdrawn from military use in December 1916, although several months were needed before horse-drawn carts and motor vehicles had fully replaced them.
The French had 250 dogs at the start of World War I. The Dutch army copied the idea and had hundreds of dogs trained and ready by the end of World War I (the Netherlands remained neutral). The Soviet Red Army also used dogs to drag wounded men to aid stations during World War II. The dogs were well-suited to transporting loads over snow and through craters.
Dogs were often used to carry messages in battle. They were turned loose to move silently to a second handler. This required a dog that was very loyal to two masters, otherwise the dog would not deliver the message on time or at all. Some messenger dogs also performed other communication jobs, such as pulling telephone lines or cables from one location to another.
A 2-kilogram (4-pound) Yorkshire terrier named Smoky was used to run a telegraph wire through a 10-to-20-centimetre-diameter (4-to-8-inch), 21-metre-long (70-foot) pipe to ensure communication without moving troops into the line of fire.
Main article: Military mascot
Dogs were often used as unit mascots for military units. The dog in question might be an officer's dog, an animal that the unit chose to adopt, or one of their canines employed in another role as a working dog. Some naval dogs such as Sinbad and Judy were themselves enlisted service members. Some units also chose to employ a particular breed of dog as their standard mascot, with new dogs replacing the old when it died or was retired. The presence of a mascot was designed to lift morale, and many were used to this effect in the trenches of World War I. An example of this would be Sergeant Stubby for the US Army.
Main article: Animal testing
In World War II, dogs took on a new role in medical experimentation, as the primary animals chosen for medical research. The animal experimentation allowed doctors to test new medicines without risking human lives, though these practices came under more scrutiny after the war. The United States' government responded by proclaiming these dogs as heroes.
The Cold War sparked a heated debate over the ethics of animal experimentation in the U.S., particularly aimed at how canines were treated in World War II. In 1966, major reforms came to this field with the adoption of the Laboratory Animal Welfare Act.
Main article: Detection dog
Many dogs were used to locate mines. They did not prove to be very effective under combat conditions. Marine mine detecting dogs were trained using bare electric wires beneath the ground surface. The wires shocked the dogs, teaching them that danger lurked under the soil. Once the dog's focus was properly directed, dummy mines were planted and the dogs were trained to signal their presence. While the dogs effectively found the mines, the task proved so stressful for the dogs they were only able to work between 20 and 30 minutes at a time. The mine-detecting war dogs anticipated random shocks from the heretofore friendly earth, making them extremely nervous.[clarification needed] The useful service life of the dogs was not long. Experiments with laboratory rats show that this trend can be very extreme; in some tests, rats even huddled in the corner to the point of starvation to avoid electric shock.
Dogs have historically also been used in many cases to track fugitives and enemy troops, overlapping partly into the duties of a scout dog, but use their olfactory skill in tracking a scent, rather than warning a handler at the initial presentation of a scent.
All scout dogs must be taught the difference between human and animal scent. Some dogs are trained to silently locate booby traps and concealed enemies such as snipers. The dog's keen senses of smell and hearing would make them far more effective at detecting these dangers than humans. The best scout dogs are described as having a disposition intermediate to docile tracking dogs and aggressive attack dogs. Scouting dogs are able to identify the opposing threat within 1,000 yards of area. This method of scouting is more efficient compared to human senses. 
Scout dogs were used in World War II, Korea, and Vietnam by the United States to detect ambushes, weapon caches, or enemy fighters hiding under water, with only reed breathing straws showing above the waterline. The US operated a number of scout-dog platoons (assigned on a handler-and-dog team basis to individual patrols) and had a dedicated dog-training school in Fort Benning, Georgia.
Main article: Guard dog
One of the earliest military-related uses, sentry dogs were used to defend camps or other priority areas at night and sometimes during the day. They would bark or growl to alert guards of a stranger's presence. During the Cold War, the American military used sentry dog teams outside of nuclear weapons storage areas. A test program was conducted in Vietnam to test sentry dogs, launched two days after a successful Vietcong attack on Da Nang Air Base (July 1, 1965). Forty dog teams were deployed to Vietnam for a four-month test period, with teams placed on the perimeter in front of machine gun towers/bunkers. The detection of intruders resulted in a rapid deployment of reinforcements. The test was successful, so the handlers returned to the US while the dogs were reassigned to new handlers. The Air Force immediately started to ship dog teams to all the bases in Vietnam and Thailand.
The buildup of American forces in Vietnam created large dog sections at USAF Southeast Asia (SEA) bases; 467 dogs were eventually assigned to Bien Hoa, Binh Thuy, Cam Ranh Bay, Da Nang, Nha Trang, Tuy Hoa, Phù Cát, Phan Rang, Tan Son Nhut, and Pleiku Air Bases. Within a year of deployment, attacks on several bases had been stopped when the enemy forces were detected by dog teams. Captured Vietcong told of the fear and respect that they had for the dogs. The Vietcong even placed a bounty on lives of handlers and dogs. The success of sentry dogs was determined by the lack of successful penetrations of bases in Vietnam and Thailand. The United States War Dogs Association estimated that war dogs saved over 10,000 U.S. lives in Vietnam. Sentry Dogs were also used by the Army, Navy, and Marines to protect the perimeter of a large bases
Contemporary dogs in military roles are also often referred to as police dogs, or in the United States and United Kingdom as a military working dog (MWD), or K-9. Their roles are nearly as varied as those of their ancient relatives, though they tend to be more rarely used in front-line formations. As of 2011, 600 U.S. MWDs were actively participating in the conflicts in Iraq and Afghanistan.
Traditionally, the most common breed for these police-type operations has been the German Shepherd; in recent years, a shift has been made to smaller dogs with keener senses of smell for detection work, and more resilient breeds such as the Belgian Malinois and Dutch Shepherd for patrolling and law enforcement. All MWDs in use today are paired with a single individual after their training. This person is called a handler. While a handler usually does not stay with one dog for the length of either's career, usually a handler stays partnered with a dog for at least a year, and sometimes much longer.
The latest canine tactical vests are outfitted with cameras and durable microphones that allow dogs to relay audio and visual information to their handlers.
In the 1970s, the US Air Force used over 1,600 dogs worldwide. Today, personnel cutbacks have reduced USAF dog teams to around 530, stationed throughout the world. Many dogs that operate in these roles are trained at Lackland Air Force Base, the only United States facility that currently trains dogs for military use.
Change has also come in legislation for the benefit of the canines. Prior to 2000, older war dogs were required to be euthanized. The new law permits adoption of retired military dogs. One notable case of which was Lex, a working dog whose handler was killed in Iraq.
Numerous memorials are dedicated to war dogs, including at March Field Air Museum in Riverside, California; the Infantry School at Fort Benning, Georgia; at the Naval Facility, Guam, with replicas at the University of Tennessee College of Veterinary Medicine in Knoxville; the Alfred M. Gray Marine Corps Research Center in Quantico, Virginia; and the Alabama War Dogs Memorial at the USS Alabama Battleship Memorial Park in Mobile, Alabama.
Main article: Police dog
As a partner in everyday military police work, dogs have proven versatile and loyal officers. They can chase suspects, track them if they are hidden, and guard them when they are caught. They are trained to respond viciously if their handler is attacked, and otherwise not to react at all unless they are commanded to do so by their handler. Many police dogs are also trained in detection, as well.
Main article: Detection dog
Both MWDs and their civilian counterparts provide service in drug detection, sniffing out a broad range of psychoactive substances despite efforts at concealment. Provided they have been trained to detect it, MWDs can smell small traces of nearly any substance, even if it is in a sealed container. Dogs trained in drug detection are normally used at ports of embarkation such as airports, checkpoints, and other places where security and a need for anti-contraband measures exist.
MWDs can also be trained to detect explosives. As with narcotics, trained MWDs can detect minuscule amounts of a wide range of explosives, making them useful for searching entry points, patrolling within secure installations, and at checkpoints. These dogs are capable of achieving over a 98% success rate in bomb detection.
The use of MWDs on prisoners by the United States during recent wars in Afghanistan and Iraq has been controversial.
Iraq War: The United States has used dogs to intimidate prisoners in Iraqi prisons. In court testimony following the revelations of Abu Ghraib prisoner abuse, it was stated that Colonel Thomas M. Pappas approved the use of dogs for interrogations. Private Ivan L. Frederick testified that interrogators were authorized to use dogs and that a civilian contract interrogator left him lists of the cells he wanted dog handlers to visit. "They were allowed to use them to ... intimidate inmates", Frederick stated. Two soldiers, Sergeant Santos A. Cardona and Sergeant Michael J. Smith, were then charged with maltreatment of detainees, for allegedly encouraging and permitting unmuzzled working dogs to threaten and attack them. Prosecutors have focused on an incident caught in published photographs, when the two men allegedly cornered a naked detainee and allowed the dogs to bite him on each thigh as he cowered in fear.
Guantanamo Bay: The use of dogs to intimidate prisoners in Iraq is believed to have been learned from practices at Guantanamo Bay Naval Base. The use of dogs on prisoners by regular U.S. forces in Guantanamo Bay Naval Base was prohibited by Donald Rumsfeld in April 2003. A few months later, revelations of abuses at Abu Ghraib prison were aired, including use of dogs to terrify naked prisoners; Rumsfeld then issued a further order prohibiting their use by the regular U.S. forces in Iraq.
Traditionally, as in World War II, US MWDs were returned home after the war, to their former owners or new adopted ones. The Vietnam War was different in that US war dogs were designated as expendable equipment and were either euthanized or turned over to an allied army prior to the US departure from South Vietnam. Due to lobbying efforts by veteran dog handlers from the Vietnam War, Congress approved a bill allowing veteran US MWDs to be adopted after their military service. In 2000, President Bill Clinton signed a law that allowed these dogs to be adopted, making the Vietnam War the only American war in which US war dogs never came home.
Military working dogs continue to serve as sentries, trackers, search and rescue, scouts, and mascots. Retired MWDs are often adopted as pets or therapy dogs.
There are 600 dogs serving in Afghanistan and Iraq, and that number is expected to grow substantially over the next year.