Thousands of immigrant children fleeing poverty and violence in Central America to cross alone into the United States can live in American cities, attend public schools and possibly work here for years without consequences.

The chief reasons are an overburdened, deeply flawed system of immigration courts and a 2002 law intended to protect children’s welfare, an investigation has found.

Driving the dramatic increases in these immigrants is the recognition throughout Honduras, Guatemala and El Salvador that children who make the dangerous trip can effectively remain in the U.S. for years before facing even a moderate risk of deportation.

The Obama administration estimates it will catch 90,000 children trying to illegally cross the Mexican border without their parents by the end of the current budget year in September. Last year, the government returned fewer than 2,000 children to their native countries.

The administration has asked Congress for $2 billion to spend on the issue.

“They almost never go home,” said Gary Mead, who until last year was director of the Immigration and Customs Enforcement office responsible for finding and removing immigrants living in the country. “It’s not a process that ultimately ends in easy resolutions or clear-cut resolutions.”

The situation is widely perceived as becoming a humanitarian crisis at the border. The system is now so overwhelmed that children are being housed in Border Patrol facilities ill-equipped to handle them.

The government has asked the military to open temporary shelters in Texas, Oklahoma and California.

U.S. officials, including the Homeland Security secretary, the White House domestic policy council director, and the Customs and Border Protection commissioner have described immigrant families’ concerns about education, jobs and personal safety as driving the rise in border crossings.

Only recently have officials acknowledged that perceptions that these children may be allowed to stay or that Congress soon may relax U.S. immigration laws — which is highly unlikely — may also be responsible.

The AP’s investigation, based on interviews, court records and federal data, found that such perceptions are understandable because of America’s broken system.

“That misinformation is causing some people who are in a rather desperate situation to risk their lives to come to the United States border expecting that they’ll be able to stay in this country. That is simply not true,” White House spokesman Josh Earnest said Friday.

“It’s important for viewers or those consumers of information in Central America to understand that showing up at the border illegally is not a ticket into this,” he said.

The Border Patrol has apprehended more than 52,000 child immigrants traveling on their own since the start of the 2014 budget year in October.

Most spend about a month in the custody of the Office of Refugee and Resettlement under the Health and Human Services Department before they are reunited with parents or other relatives in the United States. There is no requirement that their parents or those other relatives were legally allowed into the United States.

All the young immigrants who cross the border illegally are subject to deportation eventually. But it’s not a quick process.

The immigration court system was backlogged with as many as 30,000 pending cases before the most recent surge.

Court delays that already persist for years will grow even longer as the beleaguered system absorbs the cases for the new children immigrants. That will make the risk of speedy deportation even less likely and further fuel perceptions that crossing the U.S. border carries few immediate consequences.

Final decisions by immigration judges can take years, but that supposes immigrants dutifully attend their assigned hearings. Many won’t. As many as one-quarter of the immigrants ordered to show up in court in recent years have failed to appear, according to the Executive Office for Immigration Review, the Justice Department agency that runs immigration courts.

“The longer the process goes, the less likely it is that people will return,” said Doris Meissner, a former head of the Immigration and Naturalization Service.

“Without immediate consequences for this illegal immigration, it will only encourage more illegal immigration and more dangerous journeys by children in order to take advantage of the administration’s failure to enforce our immigration laws,” said GOP Rep. Bob Goodlatte of Virginia, chairman of the House Judiciary Committee.

Adult immigrants caught crossing the Mexican border illegally are generally removed from the U.S. within hours or days of their arrest. But a federal law dating to President George W. Bush’s administration requires that unaccompanied child immigrants must be turned over to HHS within three days. From there, many are reunited with parents or other relatives already in the United States or other sponsors before the lengthy court process beings.