The artillery barrages of World War I were long dormant when Gen. John J. Pershing readied an award for a wounded combat veteran. The soldier took shrapnel to the chest in the brutal Seicheprey campaign in France, survived gas attacks and caught a German scout.

Pershing, the commander of U.S. forces in the war, summarized his valor in a speech and pinned a medal to the soldier, who did not say a word that day in July 1921.

“He merely licked his chops and wagged his diminutive tail,” the New York Times wrote of Stubby, a Boston bull terrier already famous as a four-legged version of Sgt. Alvin York.

On Sunday, another dog was added to the hall of canine heroes: A Belgian Malinois that tore after Islamic State leader Abu Bakr al-Baghdadi in a darkened tunnel in Syria. Baghdadi killed himself with a suicide vest as the dog closed in, and the pup suffered minor wounds before returning to duty.

A photo of the dog, assigned to the Army’s secretive Delta Force, was posted by President Trump, who said the dog did “a GREAT JOB” in the Saturday raid. The dog’s name is classified, Trump and the Pentagon said, though Newsweek reported its name is Conan (after the comedian, not the barbarian).

That very good dog is part of a long, scruffy line of war dogs that have served alongside U.S. troops for more than a century. And in each major campaign, dogs have become remarkably agile on battlefields as some of the most fearsome and effective weapons.

“They have to adapt the same way humans adapt,” said Rebecca Frankel, the author of “War Dogs: Tales of Canine History, Heroism and Love.” As long as combatants plant their feet on soil, Frankel told The Washington Post, “dogs are the best nonhuman partners on the ground.”

But the United States was slow to learn that. While dogs in the Civil War were brought in as mascots, they were helpful in ad hoc ways, such as by finding sources of water.

In World War I, the Russians and Germans were using dogs on the battlefield before the Allies, Frankel said, until Lt. Col. Edwin Hautenville Richardson, a British commander and already a noted dog training expert, lobbied for their use. “The affection for a master and the love of reward” is a powerful tool, he wrote.

War dogs proved themselves uncanny messengers when communications were compromised. Dogs, after learning a trench line, could rush messages at vital moments of attack. A small retriever sped through seven miles of bombardment in 55 minutes to deliver a message. One dog finished its mission after its jaw was nearly severed by a bullet.

“Their will to complete a mission is pretty unflappable,” Frankel said.

Other dogs were shot, and enemy troops would try to lure them with food to prevent them from delivering their messages. But their training compelled them to stay with their friendly handlers, Frankel said.

Stubby was injured by enemy gas, and after becoming especially sensitive to the poison, he roused troops awake with barks and bites, according to the Smithsonian, which now houses Stubby as a stuffed exhibit.

But dogs were not used to their full battlefield potential until World War II, Frankel said, after formal training was provided and dogs were donated by civilians through the program Dogs for Defense.

Suddenly family pets from five breeds — German shepherds, Belgian sheepdogs, Doberman pinschers, farm collies and giant schnauzers — were on battlefields helping U.S. troops on sentry duty.

They could sniff out enemy troops at a range of 1,000 yards — a useful tactic to flush out Japanese troops lurking in underbrush, Frankel noted in her book.

Chips, perhaps the most famous dog of World War II, was shot in the face after rushing an enemy machine-gun position in Sicily. He was awarded the Silver Star and Purple Heart. He later bit Gen. Dwight D. Eisenhower on the hand before returning to his family in New York.

His family noted the trauma evident in Chips. The dog “doesn’t seem to wag his tail as much as before going to war,” the Times reported then, according to Frankel.

In the jungles and rice paddies of Vietnam, an elusive enemy guerrilla force made patrol and detection dogs an even more fundamental asset. Handlers adapted by sending their dogs out in front on long leashes, and a tight hold indicated few dangers around.

But if the dog stopped and the leash sagged, it meant enemy troops could be nearby, Frankel said, with the dog’s head turning toward the threat.

Working dogs were not utilized in meaningful ways in Iraq until several years after the 2003 invasion, when improvised explosive devices became the signature enemy weapon in Iraq and later in Afghanistan.

Bomb-sniffing dogs were sped to combat zones to help. By 2010, the Pentagon spent $19 billion on technology to combat IEDs that were killing and maiming troops by the thousands.

But U.S. troops still found only about half of IEDs on patrol. That number jumped to 80 percent when dogs were involved, Wired reported then.

“Dogs are the best detectors,” Lt. Gen. Michael Oates conceded in a briefing.

But that doesn’t mean they are especially well-treated by governments. The State Department’s inspector general found that dogs the agency provided to Jordan were diseased, starved and living in squalor, and some had to be euthanized.

Now war dogs are most prominent in Special Operations raids. In 2011, a dog named Cairo accompanied Navy SEALs on the raid to kill Osama bin Laden.

Troops on raids don’t rely on dogs just to sniff out bombs. But they also use the jarring, ferociously fast attack of dogs like Conan to terrify would-be threats. In the case of a handler and the dog, “the enemy now has two threats,” Frankel said.

But they can’t stay on the battlefield forever. When military dogs are retired, finding a suitable home is challenging, Frankel said. Sometimes they live with their former handlers, whose companionship helps them recover with their time in combat, Frankel said.

After delving into the war-dog world for her book, she took a shining to a Belgian Malinois named Dyngo. He served three tours of duty in Afghanistan. He was awarded a Bronze Star.

But at Frankel’s home in Washington, Dyngo wanted to keep working after he retired. He had to relearn how to be a normal dog, Frankel said, and that included hobbling along with a cast on his leg after two surgeries.

“He carries on,” Frankel said. “He’s like a little tank.”

Read more Retropolis: