Sergio Carrillo had already been handcuffed in the Home Depot parking lot when an officer wearing a Homeland Security uniform appeared.
"Homeland Security?" Carrillo asked. "What do you want with me?"
Ignoring Carrillo's demands for an explanation, the officer ordered the 39-year-old taken to a federal detention facility in downtown Los Angeles for people believed to be in the country illegally.
"You're making a big mistake," Carrillo recalled saying from the back seat to the officers driving him. "I am a U.S. citizen."
The arrest last year was the start of a perplexing and frightening ordeal for Carrillo, who said in an interview with The Times that immigration officials scoffed at his repeated claims of citizenship and instead opened a case against him in immigration court to have him deported. It would take four days for government officials to concede their mistake and release Carrillo.
The case, say civil rights attorneys and other critics of the country's immigration enforcement system, highlights broader problems with how people are targeted for deportation. They argue databases used by immigration officials to determine who is and isn't in the country legally are beset by outdated and inaccurate information that leads to an unknown number of U.S. citizens being detained each year.
Since 2002, Immigration and Customs Enforcement has wrongly identified at least 2,840 United States citizens as possibly eligible for deportation, and at least 214 of them were taken into custody for some period of time, according to ICE records analyzed by the Transactional Records Access Clearinghouse at Syracuse University.
Because ICE in January stopped releasing data on those it takes into custody, it is impossible to know how many citizens have been caught up in the aggressive push to increase arrests and deportations being carried out under President Trump.
In one such case, Guadalupe Plascencia complained that she was transferred from San Bernardino County jail to ICE custody in March despite having become a citizen two decades earlier. The 59-year-old hairdresser said she was released only when her daughter showed ICE agents her passport.
On Wednesday, attorneys for Carrillo announced a settlement deal in which the government will pay him $20,000 to resolve a civil lawsuit he filed over the arrest.
A spokeswoman for ICE declined to comment about the case, citing federal privacy laws. She said in a written statement that generally "ICE would never knowingly take enforcement action against or detain an individual if there was probative evidence indicating the person was a U.S. citizen."
Carrillo, who owns a landscaping business, said he was born rather unexpectedly in Tijuana, Mexico. His parents, who had lived for years in California as legal permanent residents, had taken a trip to Mexico, and his mother went into labor early.
As a young teenager, Carrillo automatically became a U.S. citizen when his mother went through the naturalization process. As an adult, he had two serious run-ins with law enforcement: a 2007 conviction for carrying a concealed weapon and another in 2011 for sending sexually explicit material to a minor, according to law enforcement records reviewed by The Times. In the second case, Carrillo was sentenced to 240 days in jail and three years' probation, the records show.
Those crimes, and Carrillo's birth in Mexico, appear to be what put Carrillo wrongly in the crosshairs of immigration officials, according to internal ICE records reviewed by The Times.
Had Carrillo in fact been an immigrant living in the country illegally, his convictions would have made him a priority to be arrested and deported under policies implemented by President Obama under which ICE targeted serious criminals for arrest.
The ICE records show that as they prepared to arrest Carrillo, immigration officers compiled a detailed record of his crimes and concluded he was a priority for arrest under the agency's policies. In several of the records, Carrillo's birth in Mexico is mentioned and ICE officials allege that he sneaked across the border into the United States "at an unknown place and at an unknown time."
"Alert generated based on current priority assessment," an ICE record said of the decision to target Carrillo.
It is unclear how immigration enforcement officers came to the mistaken conclusion that Carrillo was an immigrant eligible for deportation, but lawyers for the American Civil Liberties Union of Southern California, which helped represent Carrillo in his civil suit, argued it should have been clear that Carrillo was a citizen.
In 2011, as he was released from county jail on the sex-related crime, immigration officers questioned Carrillo, according to court papers. Carrillo explained he was a citizen and the officers let him go, apparently convinced he was telling the truth. When he was arrested years later, however, there was no mention of the prior encounter in any of the various databases ICE maintains, the lawsuit said.
And those databases, ACLU lawyers said in court documents, included no information that indicated Carrillo was an immigrant in the country illegally.
"In fact, the agents did not know anything about him except that he was born in Mexico," lawyers wrote in the complaint. "Days before his arrest, ICE agents searched their databases and found no information at all. Relying solely on the absence of information in their databases and his national origin, ICE agents sought to arrest him."
ICE did not address the claims in its legal response to the lawsuit.
On the July 2016 morning he was arrested, Carrillo said he received a phone call from a blocked number as he was walking into a Home Depot in Rialto. The man on the line asked Carrillo to identify himself and inquired about his location, Carrillo recalled.
Carrillo mentioned his location but quickly hung up when the man refused to give his name. About 10 minutes later, a text message from another number flashed on his phone, "Where you at?"
As he stepped out of the store, Carrillo was arrested. At the processing facility, as he was fingerprinted and photographed, Carrillo said he told officers repeatedly that he was a U.S. citizen. The officers either ignored him or laughed at the claim, Carrillo said.
"They didn't want to hear it," he said.
After being allowed to make a phone call to an uncle, Carrillo said his son brought a passport and a certificate of citizenship the government issued Carrillo but that ICE officers refused to review the documents.
After several hours, Carrillo and another detainee were driven to a privately run immigration detention center in Adelanto, 85 miles outside Los Angeles in the Mojave Desert.
For the next two days, Carrillo said, he told any guard he came across that he was a U.S. citizen, but he was told he had to file his complaint in writing to an ICE officer who was assigned to his case. He said he did so, but received no response.
Carrillo and ACLU attorney Jennie Pasquarella said ICE officials responded only after his family members found an attorney willing to intervene. When the lawyer forwarded copies of Carrillo's citizenship documents, he was released.
The refusal by ICE officials to listen to Carrillo's claims of citizenship appeared to violate an agency policy that requires officers to thoroughly and quickly investigate such claims. If there is any doubt whether someone is a citizen, the policy instructs officers not to arrest the person until the confusion is resolved.
7:15 p.m.: This article was updated with a statement from a spokeswoman for ICE.