For more than two decades, Sigifredo Saldana Iracheta insisted he was a U.S. citizen, repeatedly explaining to immigration officials that he was born to an American father and a Mexican mother in a city just south of the Texas border.

Year after year, the federal government rejected his claims, deporting him at least four times and at one point detaining him for nearly two years as he sought permission to join his wife and three children in Texas.

In rejecting Saldana’s bid for citizenship, the government sought to apply an old law that cited Article 314 of the Mexican Constitution, which supposedly dealt with legitimizing out-of-wedlock births. But there was a problem: The Mexican Constitution has no such article.

The error appears to have originated in 1978, and it’s been repeated ever since, frustrating an untold number of people who are legally entitled to U.S. citizenship but couldn’t get it.

“What this looks like is nobody’s ever checked it out. And it is shocking,” said Matthew Hoppock, a Kansas City attorney who specializes in federal appeals related to immigration issues.

Saldana’s case was finally resolved earlier this month, when the 5th U.S. Circuit Court of Appeals dismissed the government’s explanation of a “typo” and ruled that he had been a citizen since birth. The error, the court said, had been “perpetuated and uncorrected” by the Department of Homeland Security.

For the 49-year-old laborer and sometime carpenter, the Sept. 11 decision ended a grueling and costly ordeal. After serving a prison sentence for a 1989 drug conviction in Texas, he told authorities he was a U.S. citizen, but was deported in 1992. Between 2002 and 2007, he applied four times for a certificate of citizenship. Each time he was deported, he was separated from his family.

“I have always lived with a fear in my house that whichever night, they’ll arrive and arrest me,” said Saldana, who was born in 1964 in the Mexican border city of Matamoros, across the Rio Grande from Brownsville.

Days after the ruling, Saldana still seethed with frustration for all the rejections, for every time his family had to scrape together money to hire another lawyer. He rued time missed with his children, the low wages he endured as a worker without papers and the responsibilities that fell on his wife, Laura.

Saldana argued that he automatically became a U.S. citizen at birth because his father was an American.

But because his parents were not married, U.S. authorities claimed he should have been “legitimated” by age 21 in a process they claimed was governed by Mexican law, specifically the phantom Article 314.

A 2008 letter from U.S. Citizenship and Immigration Services cited the article and said the only way for Saldana to gain legal legitimacy would have been for his parents to marry.

The marriage never happened, but it didn’t have to.

Saldana’s birth certificate registered with the Mexican state of Tamaulipas includes both his parents’ names. The appellate court said that was enough.

At oral arguments last month in Houston, Judge Jennifer Walker Elrod was incredulous.

“So all along, that’s been in this case, and you all have been citing this over and over again to people for years now, and you can’t even look it up in Mexican law,” Walker Elrod said to government attorney Aimee Carmichael. “It doesn’t even exist.”

Homeland Security officials did not respond to a request for comment.