KABUL, Afghanistan — In many ways, the two young soldiers were not so different from each other.

Each was tough-minded and physically powerful. Each worked hard to win a place in an elite military unit, and spoke with pride of serving his country.

They were 25 years old, these two: one newly married, the other planning a wedding this year. Their upbringings were as disparate as their homelands were distant, but religious faith was entwined with the family lives of both.

Their lives ended, violently and nearly simultaneously, one evening late last month at a remote outpost in southern Afghanistan — one dead at the other’s hands.

An Afghan special forces sergeant named Zakirullah has been identified by his commanders as the man who shot and killed U.S. Army Staff Sgt. Andrew Trevor Britton-Mihalo, a Green Beret from Simi Valley, before being gunned down himself.

“We had thought he might die while he was serving in the army,” said an uncle of Zakirullah, who, like many Afghans, used one name. “But we never thought it would happen like this.”

---

At the fatal intersection of these two young lives, American and Afghan, lies the heartbreaks of the Western presence in this country, and the many ways in which two ostensible allies have both buoyed and failed each other.

As the U.S. military embarks on the task of extracting itself from America’s longest war, the phenomenon of members of the Afghan security forces turning their guns on Western troops is becoming, in the eyes of some commanders, a strategic threat.

At least 21 NATO troops have died in these assaults this year, accounting for a stunning 14% of troop deaths, with the latest shooting coming Friday in northeastern Afghanistan, the victim an American. The total number of such attacks is unknown; they generally go unreported publicly by the military if they result in injuries only.

Although all have a corrosive effect on field morale and trust, the April 25 confrontation that killed Britton-Mihalo was cause for particular alarm: For the first time, the killer was a member of Afghanistan’s special forces, handpicked from the ranks of its commandos, who are themselves considered an exclusive fraternity: carefully vetted, highly trained, closely watched.

With the NATO force preparing to end its combat role in Afghanistan, heavily freighted hopes are riding on the U.S.-mentored Afghan special forces.

They are being groomed to take the lead in nighttime raids, which have proved to be perhaps the single most effective tool in killing and capturing leaders of the Taliban and other insurgent groups. More than three dozen teams of Afghan special forces are spread across the country, partnered with U.S. counterparts in “village stability” operations meant to win the support of residents in isolated hamlets menaced by the Taliban.

In outposts like the makeshift base in Kandahar province where Zakirullah and Britton-Mihalo were deployed, the punishingly primitive, close-quarters conditions can foster strong bonds — or allow small irritants to fester.

“They work together, they patrol together, they are together all day of every day,” said Col. Bismullah Waziri, executive officer of the Afghan commando brigade. “We are all aware that there are cultural issues. Sure, they are different from us. And we are different from them.”

---

Britton-Mihalo’s military roots ran deep.

His dad was a Marine; Andrew was born in Costa Rica while his father was serving there. In December, he married Jesse Lamorte, an Army combat photographer who had served in Afghanistan with a special operations unit. He had proposed to her stateside, at a Special Forces winter ball. Two of his half brothers recently enlisted, and Britton-Mihalo had signed up for a third tour in Afghanistan.

From the beginning, his career aim was soldiering. He signed on with the Army in 2005, right after graduating from Royal High School in Simi Valley. Nobody who knew him was surprised when he made it into the elite Green Berets in 2008.

“He was something special when it came to dedication and endurance,” said Paul Mole, one of his wrestling coaches in Simi Valley, where a 5-year-old Andrew had moved after his parents split up and his mother remarried.

Mole, who now teaches at Ponderosa High School in Parker, Colo., keeps a photo on his classroom wall: It’s the Royal team that won the school’s first wrestling championship, a squad whose standout was the boy then known as Andrew Mihalo. (He adopted the hyphenated name later, combining the surnames of his biological father and his stepfather.)

The young wrestler was known for his ability to withstand pain. When his shoulder was dislocated during a match and his coaches couldn’t work it back into place, he dove onto the mat to pop it back in. He went on to win the match.

By the time of the championship bout, the 144-pound senior’s injuries had raised doubt about his ability to keep going. Early on, his opponent took him down, but as a crowd chanted, “An-DREW! An-DREW!” he managed to turn the tables, get the decisive pin, and bring home the wrestling title.

“He was so happy, he was just a ball of emotion,” recalled Rich Carrillo, Royal’s current head coach.

“He couldn’t stop crying. I put my arm around him and said: ‘From here on, your life will never be the same. You’re a hero.’ I never realized just how much of a hero he would become.”

--

As a youth, Zakirullah didn’t bear the hallmarks of a hometown hero.

Born into a typically large family in the impoverished Pashtun farming hamlet of Wazir Tatang in Nangarhar province, near the Pakistani border, he spent some of his teenage years working as a mechanic and driver while other brothers went off to university.

Though close to his family as a boy, playing and tussling with his brothers in the dry riverbed where their village lies, he became estranged from the clan in his late teens. Five years ago, he left without telling anyone and joined the army, said an uncle, Haji Naamdaar.

Military life, it turned out, seemed to suit him. After a few years, he made the cut to become a commando. And from there, he advanced to an even more severe test: a special forces battalion. Along the way, he was promoted to sergeant. He returned to the family fold, becoming engaged to a cousin in a match arranged by tribal elders.

For Afghan troops, commando and special forces training is modeled in part on the grueling winnowing process for celebrated U.S. special operations forces such as the Green Berets. Not only is physical endurance required, psychological resilience is considered a key attribute.

“Sometimes, even if they are doing something correctly, we shout at them and criticize them for doing it wrong, to see how they handle it,” said Bismullah, the colonel. “If they crack, they’re out.”

---

Why Zakirullah pulled his gun on a comrade will probably never be known.

The shooting erupted about 8 p.m. on the base, in an abandoned residential compound in the remote village of Kajoor. After Zakirullah shot Britton-Mihalo, the slain American’s fellow Green Berets returned fire, killing him instantly.

A military investigating panel, made up of Americans and Afghans, has returned from the scene but has not yet submitted its findings, and no date has been set for the inquiry’s completion. Members of Zakirullah’s team, just a month into a three-month posting in Kandahar province, has been pulled back to Kabul, the capital, for questioning and more training.

After the shooting, the Taliban claimed that the attack had been carried out at the group’s behest, specifically mentioning Zakirullah by name. Although the group could easily have learned his identity after the fact, investigators are looking at whether he could have had some link to the insurgents.

Although nearly all Afghan soldiers are observant Muslims, displays of intense religious fervor can sometimes attract attention. Zakirullah “prayed five times a day like anyone, but there was nothing unusual there,” said Col. Nabiullah Merzaee, the deputy commander of the commando center where he trained.

NATO officials say “insider” shootings are often triggered by something more mundane than religious sentiment or insurgent sympathies. A grudge, a quarrel, an affront: All can be extremely serious matters in the Pashtun culture in which Zakirullah was reared, sometimes even when the actual disagreement appears trivial.

Naamdaar said that although he remembered his nephew as a generally easygoing boy, his temper occasionally flared if he felt he was being treated with disrespect.

“In an argument,” he said, “he could sometimes go a little crazy.”

----

To his sister Michelle Carranza, a mother of four in Simi Valley, Britton-Mihalo was a “normal, average brother — a goofball who teased us.”

He loved animals. He kept snakes in his room as a boy, and always had a dog.

He was active in his family’s Mormon church. For his Eagle Scout project, he built a wheelchair ramp at the local cemetery.

In his senior year of high school, his mother moved to Missouri, and Andrew was allowed to stay behind with his best friend’s family.

“Some of my greatest memories of Andrew were sitting up till 4 a.m. in his pitch-black room, lying on his floor, solving all of the problems of the world like only brothers could,” wrote the friend, T.J. Mathias, in a Facebook tribute. “We would discuss politics, school, girls, life, movies, music, cars … absolutely whatever came to mind.”

His death at the hands of an Afghan ally is no more or less devastating than it would have been otherwise, said some who knew him.

“He was the world to me,” Carranza said. “I don’t know what was in the heart of the man who killed my brother. I don’t know what he was seeking. Those are things I’m going to leave to a higher power. If I dwell on it, I let it take over.”

--

More than 700 people have joined a Facebook page Britton-Mihalo’s friends started in his memory, posting photos of a trip Andrew took to Disneyland, reminiscences of his school days, Ronald Reagan quotes about freedom, shots of fun times with the woman now known as Sgt. Jesse Britton.

At his old school, students observed a moment of silence to mark his death.

“In high school, we create a bubble; we try to keep them young and carefree for a few years,” said Principal Deborah Salgado. “Then we send them out into an overly serious world.”

In accordance with his family’s wishes, Andrew Britton-Mihalo is to be buried at Arlington National Cemetery on May 25. Thirty days later, he would have celebrated his 26th birthday.

Back in Afghanistan, hundreds of mourners trekked from nearby villages for Zakirullah’s funeral six days after his death. Wails rang out as he was carried to a forlorn-looking cemetery less than a mile from the family home, but there was little talk of his final act. Some of those in attendance did not know how he died; others clearly felt the circumstances were best buried with him.

It had fallen to Haji Naamdaar to identify and claim Zakirullah’s corpse. In the chill of the morgue, the body lay swathed, grievous wounds hidden. All Naamdaar could see was Zakirullah’s face. Gazing down at it, he saw neither rage nor fear written on the features of his young nephew.

“I thought he might look different,” he said. “But he looked only like himself.”

laura.king@latimes.com

steve.chawkins@latimes.com

King reported from Kabul and Chawkins from Simi Valley. Special correspondent Hashmat Baktash in Kabul contributed to this report.