A foreign national being arrested in Los Angeles on Feb. 7, 2017, during an immigration sweep. (Charles Reed/U.S. Immigration and Customs Enforcement via AP)

Yintang Cao, a Chinese national who served time for hawking counterfeit designer purses, was freed from immigration detention March 31 after the United States failed to win permission from China to deport him. Emil Al Seryani, a Jordanian citizen convicted of burglary and drug dealing, was released March 7, again after deportation efforts failed.

Their quiet return to their lives in the United States contradicts one of President Trump’s signature campaign promises: to deport criminals who are not U.S. citizens, even to countries that do not want them back.

As a candidate, Trump excoriated the Obama administration and former secretary of state Hillary Clinton for releasing thousands of criminals who he said might have been deported had the United States imposed sanctions on their uncooperative homelands.

“Day One, my first hour in office, those people are gone,” Trump said last year in Arizona.

But as president, Trump is confronting the same diplomatic and legal challenges as his predecessors, including whether to jeopardize national security and economic interests so that a nation such as China will accept all Chinese citizens that U.S. authorities want to deport.

(Monica Akhtar/The Washington Post)

A former immigration official said it is ironic that Trump and his GOP supporters are stymied by the same issues they insisted could be solved quickly.

“It’s very difficult when you have recalcitrant countries that typically will not take those individuals back,” said John Sandweg, a lawyer who during the Obama administration served as acting director of Immigration and Customs Enforcement, which oversees deportations. “I’m not at all surprised to see that the Trump administration is having to release people.”

The White House said Trump is doing what he can, including signing an executive order in January that instructed the Department of Homeland Security and the State Department to deny visas to nations that do not cooperate with deportations.

“The ball is in their court,” said Michael Short, a White House spokesman.

But the State Department said it has not acted on that part of the executive order.

Denying visas to another country “is a powerful tool that we have, that is usually not something that we would jump to very quickly,” said Will Cocks, a spokesman for the State Department’s Bureau of Consular Affairs. “There are other tools that we have that we can use to try to get countries to issue travel documents and accept their nationals back.”

Washington has only imposed visa sanctions twice, preferring to negotiate with countries to persuade them to accept deportees. In 2001, the Bush administration restricted visas for Guyana, which then agreed to take back Guyanese being deported. Last year, Obama denied visas to Gambian government officials and their families, a sanction that remains in effect.

The Obama administration successfully removed tens of thousands of noncitizens with criminal records during Obama’s eight years in office, but it also released more than 86,000 criminals in the United States from fiscal 2013 to 2015. After their release, some committed violent crimes, reports of which infuriated Obama’s critics in Congress.

Some detainees were freed because of a 2001 Supreme Court ruling that bars ICE from jailing immigrants indefinitely. If their home countries will not take them back, the court said, U.S. officials have to release them. Other criminals were released on bond or for discretionary reasons.

ICE would not say how many criminals have been freed since Trump took office, and because immigration records are secret, it is difficult to know how his administration has handled those cases.

But it is possible to track some cases through federal lawsuits that immigrants have filed asking judges to order ICE to release them because their homelands won’t take them back.

Both Cao and Seryani filed such lawsuits, and ICE freed them before court rulings were handed down. Others who have sued for their release, according to court records, include Osarhieme Obayagbona, a Nigerian convicted of wire fraud and tampering with government documents, and Krunal Patel, from India, who has burglary, marijuana and drunken-driving convictions.

“There’s a lot of things Trump thinks he can do because he’s Trump,” said Jay Stansell, a retired assistant federal public defender in Seattle who has filed federal lawsuits on behalf of immigrants. “But it turns out that, no, we have a judiciary, and you can’t legislate immigration law from the White House.”

Deporting someone can take years, and this applies especially to those who no longer have up-to-date citizenship papers from their home countries. Under international law, countries are supposed to accept their citizens, but they have to issue travel documents, such as passports, before the United States can put deportees on airplanes.

Some countries cannot find the records. Other countries, such as the Soviet Union, no longer exist. And some drag their feet on cases involving individuals with criminal records or otherwise troubling pasts.

ICE spokeswoman Sarah Rodriguez would not release the administration’s latest list of countries that refuse to accept deportees; in 2016, there were 23.

Trump supporters say they did not expect the shift in deportations to be as swift as the president promised on the campaign trail.

“From our perspective it’s early on in the process,” said Chris Crane, president of the pro-Trump ICE union. “It’s pretty unrealistic to think that the administration can get all of these things taken care of in the first month or first 100 days. They’ve got a million priorities, and this is just one.”

Seryani, 39, was freed after Jordan twice refused to accept him. “Given that the agency had no significant likelihood of removing Mr. Al Seryani in the near future, he was released,” Rodriguez said, adding that ICE will keep trying to deport him.

Seryani’s criminal defense attorney, Glen T. Jonas, described his client as a “computer dork” who has lived in the United States for so long he speaks English without a foreign accent.

In his federal lawsuit, Jonas said, Seryani said he was wrongly convicted of drug possession with intent to sell and is seeking a new trial. Jonas also said ICE failed to transport Seryani to hearings in connection with his request for a new trial while he was in the agency’s custody.

Some countries have responded to Trump’s pressure to take back their citizens. In March, Trump said that Iraq agreed to accept people with final deportation orders. Later that month, officials in India said the Trump administration was pressing their government to resolve more than 270 outstanding deportation cases, a sign that the administration was using behind-the-scenes diplomacy, for now, to try to achieve its goals.

Mariam Masumi, an immigration lawyer in Arlington, said the administration’s threat to deny visas may be having some effect.

One of her clients, a Jamaican citizen who also had filed a federal lawsuit to get out of immigration detention, was deported in February after Jamaica produced his passport number, which the U.S. government had been seeking for years.

“Somehow, magically, after some time, they ended up issuing a travel document,” Masumi said. “At that point, I couldn’t do much to fight it.”

But other observers say that unless the Trump administration intensifies pressure on countries to take back their citizens, ICE agents will have no choice but to release more criminals in the United States.

“Threats may work. But they’re not going to work on everybody, because some countries are going to refuse to do it,” said Ames Holbrook, a former immigration agent who wrote a book about the release of foreign criminals in the United States.

“And then if we don’t answer those countries that still refuse, then the countries that bought the threat are going to realize that it’s not a threat.”