The judge wanted everyone in the courtroom to know that when he’d signed a war orphan over to an American Marine he thought it was an emergency — that the child injured on the battlefield in Afghanistan was on death’s door, with neither a family nor a country to claim her.

A lawyer for the federal government stood up.

“That is not what happened,” she told the judge: almost everything he’d believed about the baby was untrue.

This group had gathered 15 times by then, in secret proceedings in this small-town Virginia courtroom to try to fix what had become an international incident. Fluvanna County Circuit Judge Richard Moore had granted an adoption of the orphan to U.S. Marine Joshua Mast and his wife, Stephanie, while the baby was in Afghanistan.

Now the U.S. government insisted the baby’s fate had never been the judge’s to decide; officials in President Donald Trump’s first administration had chosen to unite her with relatives months before Moore gave her away, according to once-secret transcripts of the November 2022 hearing.

Thousands of pages of those transcripts and court documents were recently released as a result of The Associated Press’ three-year fight for access after a 2022 AP report about the adoption raised alarms at the highest levels of government, from the Taliban to the White House.

The newly released records reveal how America’s fractured bureaucracy allowed the Masts to adopt the child who was halfway around the globe, being raised by a couple the Afghan government at that time decided were her family, in a country that does not allow non-Muslims to take custody of its children. The documents show the judge skipped critical safeguards and legal requirements.

Mast, who cited a judge’s orders not to speak publicly about the case in declining requests to comment, has said he believed — and still does — the story he told Moore about the girl, and insists he acted nobly and in the best interest of a child stuck in a war zone with an uncertain future.

Along the way, high-ranking military and government officials took extraordinary steps to help him, seemingly unaware that others in their own agencies were trying to stop him.

“The left hand of the United States is doing one thing,” another judge later said, describing the dysfunction, “and the right hand of the United States is doing something else.”

The documents reveal that the court and federal government have blamed each other for the legal predicament.

The Justice Department has said what happened in this rural courthouse threatens the nation’s standing in the world and appears as an endorsement of child abduction.

“I’ll probably think about this the rest of my life whether I should have said, sorry, that child is in Afghanistan. We’re just going to stand down,” Moore said at the hearing three years ago.

The baby was orphaned in September 2019 when U.S. Army Rangers, along with Afghan forces, raided a rural compound. The baby’s parents were killed. She was found in the rubble, about two months old, burned and with a fractured skull and broken leg. U.S. troops scooped her up and took her to the hospital at Bagram Air Base in Kabul.

American service members fell in love with her there, as she recovered. She was a symbol of hope in a long, grinding war.

The raid that killed the baby’s parents targeted transient terrorists who came into Afghanistan from a neighboring country, the records show. Some soldiers believed she might not be Afghan and tried to make a case for bringing her to the U.S.

The State Department attempted to make its position clear: The embassy convened a meeting that October with members of the military and the Afghan government to explain that under international law the U.S. was obligated to reunite her with her family, according to documents. State Department officials wrote that Mast, a military lawyer on a short assignment in Afghanistan, attended that meeting.

He’d met the baby for the first time days before and remained determined the child should go to the U.S., according to emails filed as exhibits.

Mast called home, where his wife was with their three sons.

“With us having children of our own, we see how vulnerable and precious children are,” Stephanie Mast testified. “And we wanted to help in whatever way we could.”

The baby faced a future that would mark her with the trauma of losing both parents, combat-related injuries, and uncertainty of status.

However, what followed was a tangled tale of mistaken identity and bureaucratic mistake that would lead to legal upheaval.

Adoption cases usually creep through the court system. Moore granted the Masts the temporary adoption in a weekend, hearing claims that she needed immediate medical care.

Though the baby was being cared for by the Defense Department, the federal government insisted it received no notice of Mast’s bid for adoption, the recently released records show.

Had it been notified, government lawyers said, they would have told the judge that the child was not stateless, the government was at that time searching for her family and would soon decide she was Afghan and not the child of foreigners.

In December of 2020, Moore granted a final adoption, deeming the Masts the baby’s permanent parents.

“She is an undocumented, orphan, stateless minor,” he wrote, “subject to this court’s jurisdiction.”

In March 2023, however, Judge Claude Worrell Jr. voided the adoption, emphasizing that Afghanistan claimed her as its citizen and so had the right to determine her fate.

As the years dragged on, the child remained with the Marine and his family. The case continues to unfold, highlighting the complexities of international law, familial rights, and the responsibilities of foreign nations towards vulnerable children amidst conflict.

The Afghan couple raising the girl have openly expressed their heartbreak and desire to reunite with the child, complicating the emotional landscape of an already fraught situation.