Editor's Note: This story has been edited throughout. An earlier version was inadvertently published.
Hossein Mahrammi, who helped U.S. development authorities in Kabul rebuild his war-torn country, expected a warm welcome when he arrived in the United States this month.
The economist had planned to stay in Afghanistan but left because he feared for himself and his family. One by one, he saw that his colleagues were assaulted or killed because they worked with Americans.
But when he landed with his wife and four young sons at Dulles International Airport in Virginia, they were detained.
"I was expecting or dreaming that they welcome in a way," Mahrammi said, "Maybe through some separate line, offering us tea, and welcome us. But it was not like that."
Mahrammi had a so-called special immigrant visa, or SIV. This category of visa was created for people who worked with the U.S. government or contractors in Iraq and Afghanistan, at great risk to themselves. In return, they were promised green cards.
Several such visa holders have been detained or threatened with deportation by federal immigration officers in recent weeks.
While courts have put President Trump's travel ban on hold, his administration is making it tougher to get visas from certain parts of the world, and has vowed to ramp up screening of people entering the U.S.
And the law gives federal immigration officers broad discretion to turn away foreigners at ports of entry, even if they have proper documentation.
Immigrant rights groups say officers with U.S. Customs and Border Protection, or CBP, have become too aggressive at airports and border crossings. The International Refugee Assistance Project is trying to document cases of visa holders and refugees, who had been vetted, encountering trouble getting past federal border agents.
Immigration advocates point out that it's not easy to get an SIV. The process involves extensive background checks by the State and Homeland Security departments. In the case of Hossein Mahrammi, it took two years.
Becca Heller, director International Refugee Assistance Project, said she couldn't find a single example of anyone holding a special immigrant visa being detained or deported by CBP officers — until this month.
"I would assume that there are dozens, if not hundreds more cases, that nobody ever finds out about," Heller said. "It just begs the question of whether what they're doing is based on actual actionable intelligence, or just on the fact that they are sort of running amok right now."
A Customs and Border Protection spokeswoman declined to comment on individual cases.
David Aguilar, a former acting commissioner of CBP, disputes that officers are acting improperly. "What it tells me is that Customs and Border Protection is doing what they have been charged with doing," he said.
He noted that a visa alone doesn't guarantee entry to the US. The law specifies 60 different grounds for a border protection officer to reject someone. Aguilar says those officers are even trained to look at body language.
Aguilar said officers are trained to heed red flags, including "if the officer believes the individual is nervous, is evasive, eye contact is not there, or the line of questioning just does not match up with the answers."
"If they are not allowing immediate entry into the US, there is a reason for it," he said.
CBP officers pulled Mahrammi and his family aside when they got off the plane, and started asking a lot of questions. Finally, after five hours, he and his family were allowed in. But his case could have gone very differently. That same week, another SIV holder from Afghanistan landed at the airport in Newark, New Jersey.
"Once he arrived, he was put into detention, questioned without a lawyer, and forced to sign papers he didn't want to sign," said Alexander Shalom, senior staff attorney with the ACLU of New Jersey.
He's representing the man known in court papers only as John Doe, to protect his privacy. Hours before the man was set to be deported, his lawyers raced to court. One federal judge ruled against them. So they asked for an emergency hearing before the Third Circuit Court of Appeals.
"The government was planning to put him back on a plane," Shalom says, "until we got the Third Circuit to prevent them from doing that."
That man is still in detention. Federal authorities have yet to tell the ACLU why they won't let him into the country.
Also this month, in Los Angeles, officers detained a family of five travelling on a special immigrant visa. They were eventually released, but only after an emergency court order.
"What seems to be going on is a tremendous amount of discretion being given to these CBP agents, without much guidance," said attorney Robert Blume of the firm Gibson, Dunn and Crutcher, which is representing the family.
A week after landing in the U.S., Mahrammi and his family still don't have any furniture at their apartment in Maryland. So they're sleeping on the rugs they brought with them from Kabul. Mahrammi isn't complaining. If his family had to go back to Afghanistan now, he said, they'd become targets.
"This time, much in danger," Mahrammi said. "Because we would be clear and distinguished target."
The broadcast version of this story was produced by Wilma Consul and edited by Laura Smitherman.
Copyright 2020 NPR. To see more, visit https://www.npr.org.