Obaidullah Amin made his way last week to the Kabul airport with his wife, Maryam, and their two children, joining thousands of other Afghans desperate to board a plane to safety.

Unlike many others teeming outside the airport, Mr. Amin had a golden ticket—a letter from a member of Congress attesting to his work as a translator for the U.S. military and urging his evacuation.

“Introduce yourself to Marines, show the letter, stand strong,” Andrew Darlington, a former Marine Captain who worked with Mr. Amin on a deployment to Afghanistan, texted him from his home in Florida. “You have served with them, introduce yourself. You’re one of us.”

Mr. Amin would still need to get through the crowds and past the security checkpoint at Abbey Gate. Mr. Darlington also gave him a plan for that: Carry a sign with the numbers “1,2,3,4” on it. That was a code for Marines at the gate to expedite his path.

The Amins almost made it. But as they neared the checkpoint last Thursday, a suicide bomber detonated 25 pounds of explosives, killing Mr. Amin, his wife and more than 200 others, including 13 Americans, most of them Marines.

Mr. Amin was among the thousands of Afghans who swarmed Hamid Karzai International Airport since the chaotic fall of Kabul on Aug. 15, seeking to flee the Taliban for fear of reprisals for working with U.S. forces.

President Biden deployed roughly 5,800 U.S. troops, including Army and Marine Corps units, to assist in the evacuation of Americans, their allies and Afghan citizens who had helped them.

Mr. Amin and U.S. Marines.

Photo: Andrew Darlington

But as the clock ticked toward Tuesday’s deadline for U.S. withdrawal, the threat level surged, U.S. officials said, with one suicide bomber in a position to shatter the delicate balance of security that had allowed some Afghans in jeopardy to leave.

Those fears were realized Thursday afternoon, with fatal consequences for both Afghans and the Marines there to help them.

Mr. Amin already had been working as an interpreter when Mr. Darlington arrived with his unit in Sangin in March 2012. They got to know each other as Mr. Darlington hung out at the interpreter’s living quarters because it was known for having such good food. Soon enough, he and Mr. Amin were out on operations together.

Mr. Amin first applied for his special immigrant visa in 2015, with Mr. Darlington writing him a letter of recommendation, along with other Marines. The process ended in a rejection from Washington, an appeal from Mr. Amin and a long stalemate.

Then the Taliban swept through Afghanistan this month, capturing large sections of countryside and the provincial capitals before ultimately taking Kabul. Mr. Amin, who had spent years helping Americans, considered himself a prime target.

Mr. Darlington, now an attorney in Miami, texted Mr. Amin Aug. 15 on WhatsApp, imploring his former interpreter to get out. The couple and their two young sons, ages 3 and 21 months, went to the airport but were discouraged by the crowds of people and stifling heat. The family returned home.

The Taliban celebrated their victory in Kabul on Aug. 15, adding to the urgency of escape planning for translators and other Afghans who helped the U.S. over the years.

Photo: Victor J. Blue for The Wall Street Journal

Mr. Darlington said he pressed Mr. Amin to try again, saying the Taliban would find him and kill him. Go alone, his old Marine friend said; your family isn’t likely to be in as much jeopardy. Mr. Amin refused to leave his family, instead hunkering down and hoping for news that the airport logjam would ease.

By Aug. 23, Taliban patrols were knocking on doors in Mr. Amin’s neighborhood in District 15 on the outskirts of Kabul, the translator told his American friend.

“Sir the Taliban started searching home by home with our neighbors,” Mr. Amin texted.

Mr. Darlington told Mr. Amin to hide any documents that could tie him to Americans. Mr. Amin punched a hole behind a low kitchen cabinet and stashed the papers there, stacking dishes in front. “Time is short, my sir,” Mr. Amin texted Mr. Darlington at one point.

Taliban militants took control of Kabul’s airport after the last U.S. cargo plane took off before President Biden’s Aug. 31 deadline. The departure marks the end of America’s longest war, which lasted nearly 20 years. Photo: Taliban Handout/Reuters The Wall Street Journal Interactive Edition

By Tuesday Aug. 24, a member of Congress emailed the support letter to Mr. Amin. That would help the family board a plane, but they would still have to get through the airport crowd—with tens of thousands of Afghans waving various letters of their own. Mr. Amin would need something else to get the attention of Americans at the checkpoints.

Mr. Darlington turned to fellow former Marines for advice. They steered him to the Signal app, where military veterans, ex-diplomats and former spies—many angry over what they saw as a feckless U.S. response to a crisis—were trading tips on getting Afghans out with networks of friends and colleagues.

“This evacuation, instead of one official avenue, was all these underground networks,” Mr. Darlington said. “It’s a bunch of people across a bunch of different networks all working for the same cause, of saving a life.”

Mr. Amin’s brother-in-law, Mirabdullah Sadat, who also lives in Kabul, said he got a call Thursday morning from Mr. Amin. Mr. Amin told him that his friend in the U.S. had a plan to sail through the crowds, Mr. Sadat said. The whole family—and not just Mr. Amin, as Mr. Darlington had advised—would leave for the airport that day. Mr. Sadat was invited to come along.

At left, a photo sent from Mr. Amin from before the bombing, when Mr. Amin and his family were close to the gates. At right, a photo from Mr. Amin’s phone, shortly before the bombing.

The family of four, plus Mr. Sadat, his wife and another of Maryam Amin’s siblings, squeezed into a taxi for the airport, but crowds and roadblocks halted their progress, Mr. Sadat said. They walked the last 2 miles, he said. Gunshots could be heard as they neared Abbey Gate, Mr. Sadat said, and Mr. Amin told his wife they should go home.

Maryam said the family needed to press on and leave the country for the sake of their children.

From Florida, Mr. Darlington initiated texts between himself, Mr. Amin and a Marine officer inside the airport that he knew from his days at the Naval Academy. The officer told Mr. Amin to take a photo of his surroundings so he could spot him and guide him in.

The Amin family was close, the officer texted after seeing the photo. Keep pushing forward, he said, and change the sign—“1, 2, 3, 4” was an old password. The new one was “Professionals.”

The family was advised to walk to an open sewer near the Abbey Gate, Mr. Sadat said. Afghans were trying to cross the channel of fetid water to plead to American troops there to let them in. When they arrived, Mr. Darlington texted Mr. Amin his friend’s name and told Mr. Amin to scream it out at the gate. Mr. Amin texted back. He was still outside the gate. The Marines didn’t seem to care about his “Professionals” sign or the name he kept shouting, Mr. Amin said, according to Mr. Darlington.

Mr. Darlington’s Annapolis buddy inside the airport hadn’t spotted Mr. Amin.

Mr. Amin texted that the family was ready to give up and return home.

“I said, if you leave the Taliban has you,” Mr. Darlington recounted, urging him to stay at the gate and keep trying.

“Yes sir, brother, in sh’allah,” replied Mr. Amin, who drew on the Arabic phrase meaning, “God willing.” It was the last text Mr. Darlington received from his friend.

Near the gate, Mr. Amin told his brother-in-law to stay behind with the children—he and his wife could get to the checkpoint more quickly without them, and then return when they made contact, Mr. Sadat said. A powerful explosion rocked the airport less than five minutes later, Mr. Sadat said.

A Taliban fighter stood guard Friday at the site where a suicide bomb detonated in a crowd largely of people seeking to escape Afghanistan.

Photo: wakil kohsar/Agence France-Presse/Getty Images

A suicide bomber wearing a 25-pound bomb detonated the device at 5:48 p.m., the Pentagon said. The explosion killed 200 people, including 13 U.S. troops both in and outside the Abbey Gate.

Mr. Sadat now has custody of the Amin children. Mr. Darlington said he and his wife would adopt the children if he can get them to the U.S., as he was trying to do.

When he last saw their parents, Mr. Sadat said, Obaidullah and Maryam Amin were standing side by side. He wore a brown shalwar kamees, a shirt that came down to his knees in the local fashion, and she wore a long summer coat. They were holding their placards over their heads trying to talk to the Marines. They were both short in stature, he said. Perhaps the Marines just couldn’t see them.

Write to Ben Kesling at benjamin.kesling@wsj.com and Alan Cullison at alan.cullison@wsj.com