An NBC Bay Area investigation has discovered tens of thousands of U.S. residents, adopted as infants from foreign countries, and raised in the United States, now face possible deportation — because they are technically not citizens. California has the highest number of adoptees in the nation. The chart below shows how many people are at risk.

!function(){"use strict";window.addEventListener("message",function(a){if(void 0!==a.data["datawrapper-height"])for(var t in a.data["datawrapper-height"]){var e=document.getElementById("datawrapper-chart-"+t);e&&(e.style.height=a.data["datawrapper-height"][t]+"px")}})}();

This adoption crisis has become a reality for thousands because of a flaw in the U.S. Immigration system. Anyone who was properly adopted (see this link for requirements) after 2000 became a citizen when they arrived in the United States. But for those adopted before that, a single missing document can lead to a life in legal limbo. And many of those adoptees who are now middle-aged may not even know they are at risk. One of those people — now in legal limbo— contacted NBC Bay Area’s Investigative Unit when he learned he and his family were at risk of being separated — all because of a missing document.

His first name is Liam. Because of his precarious legal situation NBC Bay Area won’t reveal his last name or exactly where he now lives. He grew up in San Francisco’s Inner Richmond, and recalls the "first world luxuries of his youth."

"My whole neighborhood and friends and I used to trick or treat at Robin Williams’ house, the late great Robin Williams ... and once or twice in our youth we were lucky enough to see him handing out candy," said Liam. He drives past the local pizza shop, the playground where he learned to ride a bike, and the sidewalk where he etched his name in wet cement.

It’s a world away from where he was born, the jungles of Brazil.

"I knew I was adopted," said Liam. "But especially in the neighborhood in San Francisco I grew up in — it was very culturally diverse. So I actually kind of didn't ever feel that I was special or different in any way. I felt like I was just one of the other kids and was always accepted as such."

Court documents show he was legally adopted in San Francisco. But he never knew — until recently — that his legal adoption did not make him, technically, a U.S. citizen.

"I went to school, played sports with friends, got married. You know all these other various things. [I] never thought for a second, like, you know this would be — a question," Liam told NBC Bay Area.

Life for Liam and his family changed when he had to get a background check from the U.S. Department of Homeland Security for his job. Only then, after more than three decades of living as if he were a U.S. citizen, did Liam officially learn what he never in his wildest dreams imagined. He wasn’t.

"It's really nerve-wracking," he said, "to lose my wife and my daughter you know, I lose sleep over it."

Liam and Dani were married in 2013 in San Francisco. "I think as the adopted child of two U.S. citizens he inherited certain rights that he's being denied right now, and the looming threat of our family being torn apart is terrifying," Dani told NBC Bay Area.

Dani started digging for answers about what happened and what went wrong in her husband’s case because he knew little. Dani found a box in the shed, left behind by Liam’s deceased parents. Inside Dani found hundreds of documents including legal adoption papers, school records and social security records, all from Liam’s childhood growing up in San Francisco. She talked to people who knew Liam’s adoptive parents, and to old relatives in Brazil.

"We have a birth certificate from Brazil," said Dani. "We know that his birth parents were fearful to sign any kind of documents releasing parental rights or anything like that. In fact his birth mother simply left a thumbprint on the documents."

Dani discovered Liam never was given a legal document to enter the United States.

"We simply can’t find these records for Liam. We don’t know if they exist, we don’t know if they don’t," she said.

The NBC Bay Area Investigative Unit spent months confirming Liam and Dani’s story and in the process learned they aren’t the only ones facing this dilemma.

"It is very difficult for adoptees," said Joy Kim-Alessi, an international adoptee who has struggled herself to get citizenship for 27 years. "You can't go back to your own country. You left there when you were an infant. You don't speak the language. You don't have family, you don't know the culture. Your family is in America. What do you do? You're stranded!" she said.

Kim-Alessi also serves as Program Director for the Adoptee Rights Campaign. "You are caught in a quagmire, a legal quagmire that is impossible. It's impenetrable and you cannot fix it," she said.

if("undefined"==typeof window.datawrapper)window.datawrapper={};window.datawrapper["qU1Fe"]={},window.datawrapper["qU1Fe"].iframe=document.getElementById("datawrapper-chart-qU1Fe"),window.addEventListener("message",function(a){if("undefined"!=typeof a.data["datawrapper-height"])for(var b in a.data["datawrapper-height"])if("qU1Fe"==b)window.datawrapper["qU1Fe"].iframe.style.height=a.data["datawrapper-height"][b]+"px"});

The Adoptee Rights Campaign’s recent National Report to Congress estimates between 25,000 and 49,000 people adopted from 1945 to 1998 remain in legal limbo, despite the fact that foreign adoptions are sanctioned by U.S. foreign policy.

The report also estimates that an additional 7,321 to 14,643 children adopted from 1999 to 2016 are at risk of reaching adulthood without US Citizenship because of flaws in current immigration law.

"We have been brought here by law, by legal standards," said Kim-Alessi. "We are here because of that. We didn't bring ourselves here. We didn't broker our own adoptions. We are here legally."

!function(){"use strict";window.addEventListener("message",function(a){if(void 0!==a.data["datawrapper-height"])for(var t in a.data["datawrapper-height"]){var e=document.getElementById("datawrapper-chart-"+t);e&&(e.style.height=a.data["datawrapper-height"][t]+"px")}})}();

"It’s a complex process. It is something that people need to learn about," said Suzanne Lawrence, Special Advisor for Children’s Issues at the U.S. Department of State in Washington DC. It’s her job to be an advocate for children who are adopted to the United States from abroad.

When asked if she would acknowledge that gaps exist in U.S. immigration law and that those gaps cause these legal dilemmas for adoptees, Lawrence said, "Yes. We are absolutely aware of it as is the United States Citizenship and Immigration Service. And we try to work together to figure out how to get that information out to people in an understandable way so that they can take the necessary steps to get themselves in the right direction."

A law passed by Congress in 2000 doesn’t help people like Liam because the law did not retroactively protect adoptees who arrived before that date. Lawrence says the problem is further exacerbated by the complexity of the adoption process, especially when it comes to international adoption.

"I think a lot of times people come home with their child and they're a new family and they have a child to take care of, and they perhaps don't go through the process of the final steps that they needed to take to get the citizenship for that child," said Lawrence.

New legislation titled the Adoptee Citizenship Act Of 2018 would have patched the holes in current US immigration law, but that proposal died in Congress in September, 2018. Nevertheless, Liam and Dani took their case to Senator Diane Feinstein’s office to try to get a resolution.

"My hope is that [by] us coming forward we can provide some clarity to our situation and potentially some guidance to other impacted adoptees," said Dani.

"Everything that I know and have come to know as my daily life, my way of life, my wife, my daughter, my friends, my family -- deportation, would mean I'd be sent to a country that I've never lived in," said Liam. "I don't know the language. I would lose everything that I've spent my life here building and would literally be left with nowhere to turn. And that, obviously, is shaking me to my very essence."