Migrants gather inside the fence of a makeshift detention center in El Paso on March 27. (Sergio Flores/For The Washington Post)

President Trump’s rising frustration with the influx of migrants across the U.S. southern border has increasingly focused on the U.S. asylum system, as he alleges that applicants are carrying out a “big fat con job” to gain entry to the country and that U.S. laws offering protection from persecution are hampering his efforts to protect the nation from illegal immigration.

A record number of Central American families have been crossing the border in recent months, in part because migrants know they can seek asylum under federal law and that they likely will be released into the United States pending court hearings about their claims. Because asylum seekers have flooded the U.S. immigration system, there are not enough detention beds to hold them, and a massive backlog of cases means migrants often get months — or years — to stay in the United States before a judge sees them.

Almost every tactic Trump has deployed to discourage them from trying to enter the country has failed, and, much like with his other attempts to alter long-standing U.S. policy, he has met pushback from federal judges, who often have ruled against his policies.

Separating parents from their children at the border last year devolved into a humanitarian crisis and a public-relations nightmare. A federal judge blocked Trump’s asylum ban, an ambitious effort to prevent migrants from seeking asylum if they crossed into the United States illegally. A judge this week clipped one of Trump’s latest efforts to keep asylum seekers off U.S. soil: an experimental policy — known as Migrant Protection Protocols — requiring migrants to stay south of the U.S. border until their hearings. The judge ordered the program suspended and granted entry to the plaintiffs.

Trump on Tuesday blasted the federal court rulings, calling them “a disgrace” and saying that “we have the worst laws of any country anywhere in the world.”

President Trump on April 5 said some asylum seekers are ‘gang members’ who are ‘not afraid of anything.’ (The Washington Post)

“We’re bucking a court system that never, ever rules for us,” he told reporters on Tuesday. “We have to close up the borders.”

Trump and other U.S. officials have called on Congress to alter the asylum laws and address a system that is in crisis, while advocates for immigrants say many are fleeing violence and have legitimate claims.

Even some of Trump’s critics admit that the president has a point about U.S. asylum laws not being up to the current task: U.S. immigration courts and the asylum system are overwhelmed, with 850,000 cases and 424 judges, making them inefficient and unwieldy. But as Trump’s proposed fixes implode in federal courts because of legal and procedural errors, each ruling signals to migrants that it is safe to come to the United States.

“Some people are gaming the system, but the answer to that is having the system work,” said Doris Meissner, a fellow with the nonpartisan Migration Policy Institute and a former immigration commissioner. “Trump’s solution is to deny access to the system. It’s the opposite answer.”

Federal asylum laws emerged after World War II, when the United States and other nations signed treaties declaring that political dissidents and others fleeing persecution from across the globe should not be forced to return to nations where they likely would be harmed or killed. The 1980 Refugee Act cemented those principles, and courts have upheld them.

Under the law, foreigners who reach U.S. soil can apply for asylum, but to win their cases, they have to show that they face persecution in their native lands based on their race, religion, nationality, membership in a particular social group — such as people targeted because they are gay or lesbian — or political opinion.

Foreigners can apply for asylum through U.S. Citizenship and Immigration Services, and trained asylum officers interview them, investigate their cases and award them green cards and paths to U.S. citizenship if they prevail. Or, as is happening frequently at the U.S. border, asylum seekers can step on U.S. soil, turn themselves in to U.S. authorities and state their claims to authorities.

Migrants listen to U.S. Customs and Border Protection officials after crossing illegally into the United States to request asylum in El Paso on Friday. (Jose Luis Gonzalez/Reuters)

Asylum can serve as a defense against deportation in immigration courts — which is where most Central American border crossers are landing. At the border, the largest groups of apprehended migrants are from Guatemala, Honduras and El Salvador. The United States also sees thousands of asylum claims from Chinese and Venezuelan nationals.

But their chances of success have been diminishing.

Immigration court records show the asylum denial rate rose from 21 percent in 2016, the last year of the Obama administration, to nearly 47 percent as of January. Denials might have risen partly because former attorney general Jeff Sessions said that victims of domestic violence and gang attacks generally would not qualify for asylum, an issue that is being litigated in federal courts.

The Trump administration says that many migrants skip out on their hearings and points out that just 10 percent of migrants from Central America’s Northern Triangle — Guatemala, Honduras and El Salvador — win their cases.

Melissa Crow, senior supervising attorney at the Southern Poverty Law Center and one of the lawyers working on the Migrant Protection Protocols lawsuit this week, said the Trump administration has repeatedly violated federal law by attempting to block access to asylum.

“That’s why we keep suing him,” she said. “It’s so blatant. He can’t just change the laws by executive fiat. And that’s what he’s trying to do.”

Others point out that the asylum system has in the past been hobbled by a wave of questionable claims and the United States devised solutions that satisfied immigration hawks in Congress.

Meissner, who took over as commissioner of what was then Immigration and Naturalization Service in 1993, and others faced enormous backlogs in the mid-1990s after refugees fleeing Central American wars and repression in Cuba, China and Haiti flooded the United States, according to a Migration Policy Institute report she co-authored last year.

Asylum claims hit a record high of 150,000 in 1995, according to the report.

To dissuade immigrants from filing false asylum claims, the U.S. government barred migrants from obtaining work permits for six months to give asylum officers or the courts a chance to decide their cases. Later, Congress mandated that foreigners seek asylum within one year of arriving in the United States.

New asylum claims dropped to 30,000 in 1999, the report said, an 80 percent decline from 1995.

But applications rose again, especially in the years after 2014. A decade ago, one in 100 border crossers sought asylum. That has risen to 1 in 3.

And because their cases are taking months or years to decide, thousands of migrants are again obtaining work permits, creating another incentive to seek asylum, according to the report.

Adding asylum officers, expanding courts and finding other ways to ensure that the immigration system works quickly could fix the problem, Meissner said, and failed cases would send a message to migrants that they shouldn’t try to apply if their claims are bogus.

This week, Trump signaled he might try a different approach, with U.S. officials saying the government is considering a new policy that could again split up families at the border, but this time, the choice would be up to the parents — they could stay detained while sending their children to a family member or a legal guardian. The Trump administration hopes that the threat of detention or separation could act as a deterrent.

John Wagner and Josh Dawsey contributed to this report.