(CN) – Determining someone’s citizenship status is a burden the government, not the individual, must bear, a Ninth Circuit panel found Thursday in a case involving a U.S. citizen stranded in Mexico.

Oscar Olivas sued local and national directors of Customs and Border Patrol in 2014 after he says he tried to return to the U.S. from Mexico in August 2011 and officials refused him entry.

Olivas received a Notice to Appear, which should have triggered a hearing before an immigration judge. But because the government failed to file the NTA with the immigration court for over two years, no hearing was ever scheduled. Meanwhile, Olivas languished in Mexico where he could not work because he was not a Mexican citizen.

After multiple failed attempts to inquire about the status of the hearing, Olivas filed suit seeking determination of his citizenship.

“The court’s ruling confirms when the government has treated you like a citizen your whole life it can’t take everything away from you unless it bears the burden to prove you were not a citizen,” Olivas’ attorney, Bardis Vakili with the American Civil Liberties Union, said in an interview. “We look forward to resolving the issue of Oscar’s citizenship once and for all.”

Olivas says he has a U.S. birth certificate, but his mother – a Mexican national at the time she gave birth to him in Los Angeles County – was coerced into saying the certificate was falsified in 2010 when consular officials interviewed her as part of Olivas’ application for green cards for his wife and stepson, according to the ACLU.

Olivas was issued a “delayed registration of birth” certificate in 1970 – five months after he was born – because his mother, afraid to give birth in a hospital, instead birthed him in a private residence with the assistance of a midwife, according to the complaint. He also has a certificate of baptism, Social Security card, and state-issued driver’s license that corroborate his U.S. birth.

In a 3-page unpublished order filed Thursday, U.S. Circuit Judges Jacqueline Nguyen and Mary Schroeder and U.S. District Judge Michael Simon, sitting by designation from the District of Oregon, found Judge William Hayes of the Southern District of California should not have required Olivas to bear the burden of proving his citizenship when he held a bench trial over the issue in 2015.

The panel pointed out, as the Ninth Circuit held in the similar lawsuit Mondaca-Vega v. Lynch, that a “burden-shifting framework applies in alienage determination cases.”

The government must present evidence a person is not a citizen, which the petitioner then responds to with substantial credible evidence of citizenship, and then “the burden shifts back to the government to prove alienage by clear and convincing evidence,” Thursday’s order states.

In a footnote, the panel pointed out Olivas claims he called the government’s hotline weekly for two years and visited the border seven times to inquire about his immigration hearing before the government threatened him with detention for persisting.

“The government may not benefit from its own negligence,” the panel wrote.

The order follows a Washington Post report in August that the Trump administration was challenging the veracity of birth certificates of hundreds of Latinos born near the U.S.-Mexico border in southern Texas.

The State Department has denied passports to some Latinos there, claiming midwives and physicians falsely issued birth certificates from the 1950s through the 1990s for people who were actually born in Mexico.

The Ninth Circuit sent Olivas’ case back to Hayes to apply the burden-shifting framework in determining Olivas’ citizenship status.

Olivas currently lives in Mexicali, Mexico with his wife and 14-year-old daughter who is a U.S. citizen, according to Vakili.

“Oscar, like so many people in the border community, has lived a cross-border life, living in Mexico and working in the U.S. and that’s been taken away from him,” Vakili said.

A spokeswoman for the U.S. Attorney’s Office said they do not comment on pending litigation.