The future remains uncertain for a young Afghan child whose family was killed in a U.S. night raid in Afghanistan five years ago. A Virginia appellate court voided the adoption of the Afghan war orphan, nicknamed "Baby Doe" in court documents, by U.S. Marine Maj. Joshua Mast and his wife Stephanie Mast on Tuesday. The court determined Mast never should have been granted the adoption of Baby Doe, who has lived with Mast and his wife for three years now.  

Appellate Judge Daniel Ortiz wrote in Tuesday’s order that Mast’s adoption does not fit the criteria required by state law. Ortiz said the procedural errors that led to the adoption were "so outside the scope of the adoption code" that the circuit court did not have the power to sign the adoption. From the initial adoption filing, Mast failed to inform the court that the Afghanistan government never gave up its claim to Baby Doe, and that she had been given to Afghan relatives.

Baby Doe, who turns five this month, was orphaned following a U.S. raid that killed her family in Afghanistan in 2019. At 40-days-old, Baby Doe was found in the rubble with life-threatening injuries. The Afghan government and International Committee of the Red Cross determined Baby Doe had living relatives, and united her with them as required by international law. After an investigation, the Afghan government determined Baby Doe's parents were neighboring farmers in the wrong place at the wrong time and not foreign fighters who were living in an al-Qaida compound targeted in the night raid. However, U.S. Marine attorney, Maj. Joshua Mast, caught wind of the case and he and his wife became determined to adopt Baby Doe and bring her into their family as an act of Christian faith.

AFGHANISTAN'S SCHOOL YEAR BEGINS WITHOUT 1 MILLION GIRLS BARRED FROM EDUCATION BY TALIBAN

After hearing of the baby found in the rubble, Mast convinced a judge in rural Fluvanna County, Virginia to grant him an adoption of Baby Doe from 7,000 miles away, despite Baby Doe being cared for by her cousin and his wife. During the 2021 Afghan withdrawal chaos, Mast lured Baby Doe's cousin and his wife to the U.S., promising medical care and an education for Baby Doe.

Afghan-Baby-Adoption-Voided

U.S. Marine Corp Major Joshua Mast, center, talks with his attorneys during a break in the hearing of an ongoing custody battle over an Afghan orphan, March 30, 2023, at the Circuit Courthouse in Charlottesville, Va. A Virginia appellate court ruled Tuesday, July 16, 2024, that the U.S. Marine should never have been granted an adoption of an Afghan war orphan and voided the custody order he’s relied on to raise the girl for nearly three years.  (AP Photo/Cliff Owen)

The couple carrying Baby Doe, having narrowly escaped Taliban rule, met the Masts at Fort Pickett, Virginia where thousands of Afghan evacuees were brought. The Afghan couple wept in horror when then two-year-old Baby Doe was taken away by Mast. They had misunderstood the situation after being told by Mast and his wife that they wanted to help the young Afghan family adjust to life in America and get an education for Baby Doe.

TIM SCOTT WARNS OF IRANIAN, AFGHAN 'SLEEPER CELLS' IN US DUE TO BORDER CRISIS

Baby Doe’s cousin and wife have since settled in Texas and continue to fight to get Baby Doe back in their custody. NCIS and the Navy IG have opened an investigation and gag orders have been issued on the two parties. The Defense Department said it cannot comment on the ongoing case. 

Military in Afghanistan

The British Armed Forces work with the U.S. military to evacuate eligible civilians and their families out of the country on August 21, 2021, in Kabul, Afghanistan.  (MoD Crown Copyright via Getty Images)

The Masts have insisted they acted "admirably" and are the legal parents to Baby Doe. The cousin and wife have not seen Baby Doe in nearly three years.

The appellate court decision on Tuesday does not clarify who will raise the almost 5-year-old Afghan girl. She will remain living with the Mast family for now.

AFGHANISTAN'S TALIBAN LEADERS ISSUED DIFFERENT MESSAGES FOR EID. EXPERTS SAY THAT SHOWS TENSIONS

Several legal organizations working with the Afghan couple said they were encouraged by the court's decision on Tuesday.

Virginias-Fort-Pickett-Houses-Afghan-Refugees-As-Part-Of-Their-Resettlement

Afghans stand in two lines, one male and one female, to approach the walk-up window of the hygiene distribution center at Fort Pickett on December 16, 2021 in Blackstone, Virginia. Fort Pickett normally operates as an Army National Guard maneuver training center, but converted its capabilities to house up to 10,000 Afghan refugees as of August 28, 2020.  (Jon Cherry/Getty Images)

National Center for Youth Law senior attorney Becky Wolozin told the Associated Press that by "clearly stating that the Masts have no legal rights over Baby Doe, the Court refused to legitimize their unlawful actions – actions which have led to profound and unnecessary suffering."

CLICK HERE TO GET THE FOX NEWS APP

The Associated Press contributed to this report.