The first Naval armed guard detachment (seven men under a coxswain) of World War II reports to liberty ship SS Dunboyne.Their purpose was well set out in Antisubmarine Warfare ONI Publication No. 9:
The submarine had no value as a war machine until the invention of the periscope. By the use of the periscope, partial invisibility was obtained in delivering the attack, thus giving the submarine the power of "ambush," or of making the surprise attack. The surprise attack is the reason for the submarine's existence, for without it, the submarine degenerates into slow moving torpedo boat with all its limitations.Though the publication dates from WWI, the idea was revived for the second World War.
Thus, to combat the submarine, if we prevent it from delivering this surprise, we destroy its effectiveness. In the protection of merchantmen, it should be our aim to prevent the surprise, for it is known that if the submarine once located, by maneuvering, we have a fair chance of escaping the danger of being torpedoed.
By arming merchantmen, we keep the submarine submerged, thus confining it to low speeds of small radius and preventing it from using its guns as a surface vessel.
Much more about these Navy gunners who served on merchant hull here. And a complete Navy history here titled: Office of Naval Operations History of the Naval Armed Guard Afloat
World War II from which pages comes a tale of the first sinking of a German surface ship in a surface action. When the Germans used surface raider ships disguised as merchant men to attack Allied shipping:
The Stephen Hopkins fought one of the most gallant actions in World War II against two German raiders on September 27 about midway between Capetown and Rio de Janeiro. The vessel was proceeding on a northwesterly course at about 0935. The weather was hazy. From the north two armed raiders appeared on her starboard bow. The larger, a 7,000 ton motor ship, was a mother ship and apparently unarmed forward. The smaller, a 4,000 ton motor ship was heavily armed probably with six 5.9" guns. She was probably No. 23. The Hopkins had a 4" gun aft, two 37 mm guns forward, four .50 cal. and two .30 cal. machine guns.More here, including the identity of the "Cadet" from the U.S. Merchant Marine Academy who did his duty:
Upon sighting the raiders, the Hopkins turned away to port. The larger raider immediately drew ahead. At about 1,000 yards the smaller raider opened salvo fire. Throughout the action the larger raider strafed the decks of the Hopkins with machine gun fire. Ensign Kenneth M. Willett, USNR came out on deck as the first shell struck. He was seriously wounded immediately in the stomach by shrapnel from the bursting shell. Nevertheless he continued to direct the firing of the 4" gun at the heavier armed raider until the magazine blew up. Most of the 35 projectiles struck the raider along the water line. The Cadet fired the five remaining four inch shells at the other raider. Meanwhile the machine guns from the Hopkins were sweeping the decks of the raiders and the second mate was directing the fire of the two 37 mm guns forward at the larger ship until his shell handlers were killed and the gun platform wrecked. At the end of 20 minutes the Stephen Hopkins was done for and the order was given to abandon ship. When last seen the Armed Guard officer was covered with blood but was helping cut loose the life rafts. For his action he was awarded the Navy Cross posthumously. The remaining Armed Guards were commended by the Secretary of the Navy. Only five, all wounded, survived the sinking. In addition the destroyer escort No. 354 was named for Ensign Willett. The Stephen Hopkins was awarded the Gallant Ship Citation by the War Shipping Administration.
On 18 September, the Stephen Hopkins (Paul Buck, Captain) sailed from Cape Town, South Africa, to Paramaribo, Dutch Guiana. Several days out of Cape Town, the radio operator received a message warning of German raiders. On the morning of the 27th a lookout spotted two ships in the haze flying signal flags. They were in reality the 5,000-ton raider Stier and the 7,800-ton Tannenfels. Both immediately began firing on the Liberty ship, and what ensued was one of the most remarkable surface engagements of the war. Captain Buck immediately turned the Hopkins stern to the raiders. The armed guards manned the four-inch stern gun to defend the ship. The gun crew fired as rapidly as possible on the smaller raider. Fire from the Stier killed the gun crew one by one and volunteers replaced those who had fallen. At the same time, the Tannenfels remained at a distance, raking the Hopkins with machine gun fire that was returned by the Hopkins. The Stier had a fire control system that enabled her to fire salvos and hit the Liberty ship repeatedly. One shell hit one of the main boilers, reducing the speed of the Stephen Hopkins to one knot. Shells struck the Hopkins near the waterline, and incendiary shells eventually set fire to the main deckhouse as the ship slowly sank. The Stier, however, had paid for attacking the Stephen Hopkins. The Hopkins crew had repeatedly struck the smaller raider, now in flames and in a sinking condition. After about twenty minutes of fierce firing, the master sounded the ship’s whistle to abandon ship. In one last act of defiance, Cadet Midshipman Edwin O’Hara fired the last five remaining shells from the four-inch gun, and all struck the Stier. A salvo aimed at the gun killed O’Hara after he had fired the last round. The able-bodied men helped place the wounded in the only undamaged lifeboat. This boat searched for two hours picking up survivors. The ship’s complement originally consisted of eight officers, thirty-three men, and fifteen armed guards but only nineteen men cleared the ship. Only fifteen of these men survived – gunners, one officer and nine men. After a thirty-one day trip they made landfall at a small fishing village on the coast of Brazil.And a note about a modern version of the Armed Guard here. It should also be remembered that the Naval Armed Guard also served in World War I.