Rags was as brave and hardworking as the American soldiers he fought alongside during World War I. But one key detail set him apart from the men serving in the First Division American Expeditionary Forces: He was a dog.

The stray dog turned soldier was just one of the estimated millions of dogs, horses, camels and other animals that served during the Great War. Often referred to as “military mascots,” these beasts of burden typically acted as soldiers’ companions, boosting morale when times got rough for soldiers living thousands of miles away from home.

But military mascots didn’t just lend a supportive paw: They did real work on the battlefield. Thanks to their speed, strength or agility (depending on the species), they’d take on important tasks like lugging munitions and other cargo, carrying crucial messages between units and sniffing out buried mines. But many of these animals never received any recognition for their hard work and dedication, and their short lives were largely forgotten—until now.

Recently, the National Archives completed a massive scanning project, digitizing 63,000 World War I photos for its American Unofficial Collection of World War Photographs (165-WW) record series. The extensive collection, which took two years to get online, contains images obtained from the U.S. Army Signal Corps, various federal and state government agencies and the American Red Cross. While a majority of the collection contains images of soldiers participating in various stages of military life, from training for battle to engaging in active warfare, archivists noticed something else in the photos: animals.

“I’m an animal lover,” says Kristin DeAnfrasio, an archivist who worked on the project. “As I was going through the photos, I kept seeing unique animals, like a raccoon, an alligator and a bear, that stood out to me.”

Upon further research, DeAnfrasio learned that many of the animals captured in black and white served as military mascots. (She wrote a post on the subject for the archives’ Unwritten Record blog.)

Not much is known about the animals in the collection beyond the typewritten captions that accompany each photo. But they provide rare insight into an aspect of the war that often gets left out of the history books. Animals have often served on the battlefield—the Assyrians and Babylonians were some of the first groups to recruit dogs for war purposes. Closer to home, animals were a part of the Civil War, sniffing out wounded soldiers and responding to bugle calls. However, their role is often underappreciated or unknown.

Take “John Bull,” an English bulldog who belonged to an English major general up until an American air unit adopted him. Aside from the picture in the archive, little else is known about him and his time at war. Adoption wasn’t the only way animals made their way onto the battlefield—citizens also donated their own pets in a show of patriotism.

And not all of the animals whose images made it into the archives were domesticated. Take, for example, Whiskey and Soda, two lion cubs serving as the mascots of the Lafayette Escadrille, a military unit of the Aéronautique Militaire (French Air Service). Or Dick, a monkey belonging to the Provost Guard at Camp Devens, an Army training ground in Massachusetts. Their stories have been lost to time, so today historians can only wager a guess of what their lives entailed—and if they even survived the war.

Frustrated that so many of these military animals didn’t receive the recognition that they deserved, biographer Grant Hayter-Menzies wrote a book about one of them. From Stray Dog to World War I Hero: The Paris Terrier Who Joined the First Division follows the story of Rags, a canine who went from a street dog scrounging for scraps outside a cafe in Paris to a pivotal member of the First Division.

“I wanted to write about a dog who came out of a situation where it had reasons not to trust a human,” says Hayter-Menzies. “I’m troubled by service animals in war who were [recruited] into service for something they didn’t cause. No animal ever started a war.”

Rags, who lived from 1916 to 1936, followed soldiers home after they fed him and refused to leave the battlefield. He began his military life in 1918 as a mere mascot, but soon the soldiers realized he had more to offer than just an affectionate wag of his tail. First Sergeant James Donovan taught him to deliver messages during a time when the U.S. military lacked a formal messenger service, and Hayter-Menzies credits Rags with saving the lives of "hundreds" of men thanks to the messages he successfully delivered.

“Practically overnight, Rags learned how to run messages,” Hayter-Menzies says. “He could also tell when shells were coming minutes before the men could hear it, and he would flop over [onto his side to let them know]. When Donovan would go check the mines, Rags would go with him and he was able to identify broken lines, even under foggy conditions, by running up to them and barking. How he did it, no one knew.”

Eventually, while running a message that Donovan carefully tied to his collar with telephone wire, Rags' military career came to an abrupt end. His paws and ears were injured by shrapnel, and his lungs damaged by poisonous gas he inhaled from a close-range explosion after his mask slipped off. (The message was successfully delivered.) Rags and Donovan were transferred to a military hospital in Chicago for medical care. His master succumbed to his injuries, but Rags survived. He was adopted by a military family and was their four-legged companion for the remainder of his 20 years. Today, visitors can visit his grave at Aspin Hill Memorial Park in Silver Spring, Maryland, where he was buried with military honors.

Rags’ life had a happy ending, but for many military mascots, that wasn’t the case. But at least now their memories can live on.

“Often war veterans will go to his grave and leave American flags there,” Hayter-Menzies says. “Rags shed red blood just like the rest of the soldiers. Although he weighed only 25 pounds, on his back he saved hundreds of husbands, fathers and sons. He should be honored with the same flag that they all fought under.”