“Cry havoc,” goes the line from Shakespeare’s “Julius Caesar,” “and let slip the dogs of war.”

In the case of some celebrated American pooches, the phrase can be taken literally.

Each major war seemed to produce a storied dog whose bravery and devotion made for a stirring tale. Jack was a mastiff who followed the Confederates around in the Civil War, but wisely changed sides when his unit was defeated. Katie for the Korean War. Chips for World War II. Nemo for the Vietnam War.

World War I had two famous war dogs. There was Rags, a stray picked up in Paris, known for his ability to detect incoming shells and identify broken telephone wire. He became famous, garnering write-ups in the New York Times and making parade appearances. But he was never nominated for a rank.

Not only was a foundling terrier named Stubby given a rank, but he was promoted. Sergeant Stubby was the most decorated dog of World War I. Like Rags, Stubby was a stray, and fell in with some soldiers drilling in New Haven, Conn. Cpl. Robert Conroy decided to bring Stubby to France when they shipped out, and smuggled him under his coat. A senior officer discovered the ruse. But, as the story goes, Stubby gave the officer a salute, as Conroy had taught him. Stubby stayed.

Stubby joined the 102nd Infantry Regiment, where he saw action in four offenses and 17 battles. Barrages day and night for over a month. He was wounded by a hand grenade and gassed, after which he wore a mask, and learned to use his exquisite sense of smell to alert the troops to deadly vapors.

He found wounded soldiers in the No Man’s Land between the enemy lines, and — again, because of his superhuman sense of hearing — learned to associate the whine of incoming artillery so he could warn the soldiers to take shelter.

There’s a story of Stubby finding a spy while out on patrol. He smelled something in the bushes, ran off, and was discovered with his teeth deep in the hindquarters of a German soldier snooping on the Americans.

The soldier wore an Iron Cross when captured. The Yanks relieved him of the medal, and pinned it on Stubby’s vest. For this valorous act, Gen. “Black Jack” Pershing reportedly promoted Stubby to Sergeant, which meant he outranked some of the troops who accompanied him on his surveillance missions. (Anyone who’s walked a headstrong dog knows the feeling.)

Stubby was wounded again by a grenade, but survived. So did Robert Conroy, who brought him home, once again snuggled in his coat. After the war Stubby appeared in parades, wearing the medal-spangled vest made for him by grateful survivors of the liberation of Château-Thierry.

Conroy returned to civilian life, attending Georgetown Law School. Stubby accompanied him there, as well, and found new duty as the football team’s mascot. At halftime he would trot out on the field and play with the pigskin. Fun, but probably not as much fun as chomping spy butt.

He was 10 years old when he died in his sleep in 1926. He was stuffed by a taxidermist and interred, off and on, behind a glass case at the Smithsonian, where he stares out at 21st-century gawkers with the expression of someone who learned to accept everything, to like very little of it, and count the quiet moments of safety and satiation as the best life can provide.