If you're picking up a glass of Guinness this St. Patrick's Day, savor it while pondering this story from 1917, when Ireland's famous stout was cause for true celebration: It saved lives.

The strange tale takes place in the Irish Sea toward the end of World War I. Besides the traditional dangers of crossing this busy body of water in a small craft, the years 1914 to 1918 featured the additional danger of German submarines, which targeted all enemy vessels (not just military ones) and sunk many.

This was the challenge that Guinness steamships, with cargo full of stout, faced every day crossing the Irish Sea from Dublin to their destination, Liverpool, in the northwest of the United Kingdom. The trip was about 135 miles and took most of a day, depending on the weather.

The W.M. Barkley was the pride of the Guinness fleet. Guinness bought it from Belfast shipbuilder John Kelly & Sons in 1913, just a year before the war erupted. Then, because of the conflict, the ship was requisitioned by the British Admiralty for the war effort. (Ireland was still part of the U.K. at this time, so it was a legal act of government.) By 1917, the ship was deemed unsuitable for its wartime mission and returned to Guinness for commercial use.

On Oct. 12, 1917, the Barkley set off from Dublin on its fateful trip to Liverpool, with its cargo of stout and a crew of 13. Nearly three hours into its journey, disaster struck: A torpedo from the German UC-75 submarine hit the ship and split it in two.

The crew, shocked and jolted, went scurrying for a lifeboat. As the story goes, the ship's cook, Thomas McGlue, had been making a cup of tea when the impact of the torpedo tossed the hot water, scalding his arm. By the time he got to the lifeboat, the sun had set and the ship was sinking.

"The Barkley was doing her best to go down, but the [beer] barrels were fighting their way up through the hatches, and that kept us afloat a bit longer," McGlue told the Guinness HARP magazine in 1964. "In fact, it's the reason any of us got out of there."

The floating barrels of stout in the cargo hold made it possible for eight of the 13 souls aboard to escape into the night on a lifeboat.

Now — away from the sinking ship — the surviving crew was questioned by the captain of the German submarine about the sunken boat's identity. The German captain checked the Barkley off his "hit list" and bid the sunken ship's crew good night, pointing them in the general direction of the Irish coast.

After rowing awhile, they set down the life boat's anchor and shouted all night for rescue. Around five o'clock the next morning, they were rescued by a passing ship and ferried back to Dublin.

Torpedo attacks in the Irish Sea were so frequent at the time that when the crew went to report their ordeal to government officials at the Custom House, they waited three hours to be interviewed. Eventually, they gave up waiting and went to the Guinness brewery instead.

There, the superintendent gave them a swig of brandy — even Guinness employees recognize that some situations merit stronger stuff — and sent them home.

The remains of the W.M. Barkley now rest on the seafloor about 16 miles east of Dublin Port, at a depth of about 180 feet. Broken in two, they show little evidence of the deadly drama that unfolded on that October night in 1917.

The stout barrels held in its cargo washed up on local shores for weeks after the ship sank. Those barrels were the unexpected heroes in a drama that genuinely allowed the survivors to state, with a straight face, that, yes, Guinness had actually saved their lives.

This story first appeared in Cognoscenti, member station WBUR's ideas and opinion page.

Copyright 2018 WBUR. To see more, visit WBUR.