John F. Kennedy’s heroics during World War II earned him a Navy and Marine Corps Medal and a Purple Heart—he is the only U.S. president to have earned either of those honors. Kennedy’s political supporters made a big deal of JFK’s military honors, but when asked exactly how he became a war hero, Kennedy famously said, “It was involuntary. They sunk my boat.”

The experience that distinguished Kennedy was a mission that in many ways, went terribly awry and cost the lives of two of his sailors.

The Navy Marine Corps Medal and the Purple Heart presented to John F. Kennedy in 1944. John F. Kennedy Presidential Library and Museum

The fateful mission began 75 years ago, at 2:30 a.m. on the night of August 1, 1943 in the Solomon Islands near Papua New Guinea. Kennedy was a 25-year-old Naval Lieutenant at the helm of a Patrol Torpedo (PT) boat tasked with a nearly impossible mission, to torpedo Japanese destroyers on supply runs to soldiers fighting Allied forces nearby.

If the mission itself wasn’t impossible, the conditions that night certainly made it so. “It was as dark as if you were in a closet with the door shut,” recalled one of JFK’s crewmen, Barney Ross. “It was that kind of night, no moon, no stars.”

To make things worse, only one PT boat in the four-unit squad had radar, and it took off chasing a Japanese target, leaving Kennedy’s PT 109 and the other two boats in the blind. So the three remaining craft chugged silently through the inky black sea, careful not to create a wake that could be spotted by Japanese patrol aircraft above. Phosphorescent plankton in the tropical waters turned even the smallest wake into a glowing target.

Kennedy decided to throttle just one of the PT 109’s three engines to be extra cautious. Days before, on JFK’s very first patrol, a Japanese fighter dropped two bombs close on either side of the PT 109, sending two of JFK’s crew home with serious injuries. The memory of the bone-rattling explosion was still fresh.

“Ship at two o’clock!” yelled a crewman in the forward gun turret. Kennedy could see nothing but a large white wake cutting toward them. At first, they mistook it for another PT boat, but soon made out the towering black hull of a Japanese destroyer, the first enemy ship Kennedy had ever seen up close. And this one was just 200 yards away and closing fast.

Kennedy ordered the men to battle positions and attempted to position the PT 109 to fire a torpedo. But with one active engine, there wasn’t enough time or horsepower to execute an evasive maneuver. As the PT 109 crewmen stared in horror, the 388-foot destroyer Amagiri rammed violently into the PT 109, splintering the helpless wooden boat in two.

For Kennedy, who had escaped several brushes with death as a sickly child, it seemed his luck had finally run out. “So this is what it’s like to die,” he thought.

John F. Kennedy and crewmen of the PT-109. Back Row (L-R) Allan Webb, Leon Drawdy, Edgar Mauer, Edmund Drewitch, John Maguire, John F. Kennedy (standing, far right). Front Row (L-R) Charles Harris, Maurice Kowal, Andrew Kirksey, and Lenny Thom. John F. Kennedy Presidential Library and Museum

Sure enough, two members of the 13-man PT 109 crew were killed instantly in the crash. Kennedy was spared, but thrown hard against the deck and badly hurt his back. An engineer named Johnston was tossed overboard and sucked down into the destroyer’s wake, where the turbulence of the ship’s monstrous propeller beat him like a heavyweight prizefighter before spitting him back up to the surface.

The collision ignited the PT 109’s reserve fuel, and another engineer named McMahon, the only crewman below decks, was badly burned on his face and arms before being pulled down into the depths and regurgitated on the still-burning surface.

Kennedy called out to his men, who were scattered a hundred yards away in every direction. Miraculously, the current carried the gasoline fire away from the wreckage and Kennedy, a former member of the Harvard swim team, swam out to each of the 11 survivors and guided them back to what remained of the PT 109.

Iain Martin, who spent a year researching the PT 109 sinking for his 2018 book, In Harm’s Way: JFK, World War II and the Heroic Rescue of PT 109, says that what happened next was a defining moment for the young Lieutenant, who was well-liked by his men, but unproven as a leader. When dawn broke the next morning with no sign of a rescue, Kennedy gathered the men and democratically took a vote on their next move.

John F. Kennedy aboard the PT-109 in the South Pacific, 1943. John F. Kennedy Presidential Library and Museum

“He asked them, ‘If the Japanese come after us, do you want to fight or do you want to surrender?’” recalls Martin. “And the crew said, ‘It’s up to you, boss.' That’s when JFK reasserted his command.”

JFK may have been a greenhorn Naval officer, but he was an experienced sailor and navigator from his privileged youth in Cape Cod. In his short time in the Solomon Islands, he knew the layout of the islands and the strange currents running in between them. He pointed to a speck on the horizon, a small island three miles away called Plum Pudding, and ordered the men to prepare for a long swim.

McMahon’s burns were still fresh and agonizing. In what’s perhaps the most enduring image of Kennedy’s heroism in the South Pacific, the young lieutenant, himself suffering from a serious back injury, cut a strap from McMahon’s life jacket and clasped it in his teeth. For the next four to five hours, JFK swam breaststroke across the open ocean towing McMahon behind him. When he finally crawled ashore Plum Pudding island, Kennedy became violently ill from all of the seawater he had swallowed and collapsed in exhaustion.

READ MORE: How JFK's Stint as a WWII Journalist Influenced His Presidency

With just two pistols between the 11 of them, and zero food, Kennedy and his men were beached in hostile territory on an island with no fresh water and only green coconuts hanging high in the palm trees. It would be a week before the men were rescued. Back at the American PT base on Rendova, the crew of the PT 109 had already been giving up for dead.

That first night on Plum Pudding, Kennedy went on a solo mission to try to intercept PT boats traveling through nearby Ferguson Passage. Carrying a bulky lantern and with a pistol tied around his neck, JFK waded over razor-sharp reefs and swam out into the tar-black open ocean. His plan was to signal the ships with his lantern or fire the pistol to get their attention, but no boats materialized.

Trying to swim back to Plum Pudding, Kennedy was carried away by a rogue current and completely lost his bearings. He passed an interminable night in the oddly cold waters, convinced he was never going to see the island or his crew again. But by some miracle, as the morning dawned, he realized that another current had brought him right back to Ferguson Passage. Kennedy had ditched his shoes during his long night’s float and had to make his way barefoot over the reef, badly cutting his feet.

Watch a preview of the two-night event Presidents at War, premiering Sunday, February 17 at 8/7c.

The next day, Kennedy convinced the now-starving men to try another island further off which might have edible coconuts. Again, he towed McMahon with his teeth as they made the three-hour swim to what would become known as Bird Island. It earned its name from the copious amounts of bird poop covering the leafy bushes. Unfortunately, the men only noticed the droppings the morning after attempting to drink fresh water from the leaves in the dark. At least there were some coconuts on the ground from which to salvage water and meat.

On August 5, four days after the fateful collision with the Japanese destroyer, Kennedy finally caught a break. While island hopping looking for food, JFK and his crewman Ross were spotted by two men that the Americans feared were Japanese soldiers, but turned out to be islanders friendly to the Allied cause. The two native men later found the crew on Bird Island and through elaborate hand gestures promised to get a message to the PT base at Rendova. But how would these two men, who spoke no English, get word to the Americans?

Kennedy grabbed a smooth-shelled coconut and roughly carved into it with his pocket knife: “NAURO ISL COMMANDER . . . NATIVE KNOWS POS'IT . . . HE CAN PILOT . . . 11 ALIVE NEED SMALL BOAT . . . KENNEDY.” Improbably, the shell made its way into the hands of a New Zealand infantry patrol, who helped JFK get in radio contact with the PT base. JFK would hold on to that shell throughout the war and have it made into a paperweight that he kept on his desk in the Oval Office.

John F. Kennedy shakes hands with Captain Conklin after being presented with a medal for heroism in service in the Navy during WWII. Corbis/Getty Images

When the PT rescue boat finally made its rendezvous with the PT 109 crew at 11:30 PM on August 8, Kennedy called out, “Where the hell have you been?” to which the crew leader replied, “We got some food for you.” JFK, never at a loss for words, answered back, “No, thanks. I just had a coconut.”

Just three years later, JFK won his first political race for a US House of Representatives seat in his hometown of Boston and his reputation as a Purple Heart-winning war hero played no small part. Barbara Perry, director of presidential studies at the University of Virginia’s Miller Center, says that JFK’s father, the influential businessman and politician Joseph Kennedy, played up his son’s hero status during campaigns, as did the newspapers and magazines, but that JFK himself didn’t wear it on his sleeve.

“He was a humble person in general, but also felt terribly guilty about losing those two men,” says Perry. “He did think it was his fault.”

The PT 109 experience left an indelible mark on the man who would become the nation’s 35th president. Perry believes the crucible of warfare forced a mantle of leadership onto JFK that served him well politically .

“I firmly believe, that as much as I was shaped by anything, so I was shaped by the hand of fate moving in World War II,” JFK said on the campaign trail in 1946. “Of course, the same can be said of almost any American or British or Australian man of my generation. The war made us. It was and is our single greatest moment.”