“These are people who haven’t been charged with a crime being held in jail-like settings with very little due process,” said Marc Rosenblum, an expert on U.S. immigration. Being detained makes it much harder for an immigrant to find a lawyer and mount an adequate defense against deportation.

Federal law permits the government to lock up immigrants facing deportation hearings if they pose a flight risk or danger to society. According to a BuzzFeed News analysis of a vast federal database of deportation cases, the first analysis of its kind in the nation, three-quarters of all Mexicans facing deportation on noncriminal grounds were placed in detention centers. For Guatemalans, the next most frequently detained group, the rate was 61%. For China and Cuba, longtime adversaries of the United States, the rates were 19% and 16%.

BuzzFeed News has found stark disparities in how the government uses its detention authority in immigration cases, with Mexicans facing far harsher treatment than immigrants from any other country.

Immigration and Customs Enforcement, the division of the Department of Homeland Security that determines whether to incarcerate immigrants awaiting deportation hearings, declined to comment on BuzzFeed News’ findings.

It is not clear why Mexicans facing deportation get incarcerated at such high rates compared with other nationalities. Excluding Mexican immigrants, only 39% of cases analyzed by BuzzFeed News resulted in incarceration.

There is no publicly stated policy mandating tougher treatment for Mexicans. However, the discrepancy is so vast that several experts told BuzzFeed News the figures suggest a system-wide bias against Mexicans.

Restricting the flow of unauthorized immigration from Mexico — which is far greater than that from any other country — has for decades been the primary focus of U.S. immigration policy. One way the federal government has tried to meet that goal, according to testimony in a recent lawsuit, is by using detention to deter other undocumented immigrants from crossing the border. In a recent opinion in that lawsuit, a federal judge wrote, based on the government’s own admissions, that his court “is satisfied that ICE has a policy of taking deterrence of mass migration into account in making custody determinations.”

Some legal experts say that approach places federal immigration policy at odds with the law. In February, the judge in the above lawsuit ruled that government could not use deterrence to justify jailing Central American families. That ruling was based in part on a Supreme Court decision from 2002 that civil detention cannot be used for “retribution or general deterrence.” As a result, said Peter Markowitz, director of the immigration clinic at Yeshiva University’s law school, the high rate of detention for Mexican immigrants “raises serious questions about whether detention policy is being used illegally to deter immigration from certain regions.”

An agency spokesperson did not directly respond when asked whether ICE incarcerates immigrants for deterrence. However, the spokesperson said that “ICE is charged with administrative detention, meaning that ICE cannot hold individuals for punitive reasons. Individuals who come into ICE custody can only be detained in order for ICE to remove them from the country.”

In interviews, three former ICE officials who spoke on condition of anonymity said they did not believe that the higher rate at which Mexicans are detained was intended to deter others from entering the U.S. Two of the former officials instead suggested that Mexicans were so common in the immigration system that detaining them had become a matter of routine — and expediency.

Since 2009, Congress has required that ICE maintain a certain number of detention beds — currently 34,000 — every year. ICE interprets this language as requiring that the detention beds be filled. With so many undocumented Mexican immigrants to process and so many beds to fill, the former officials say, locking the immigrants up is the default choice, regardless of the particulars of their case. “It’s based on ‘How much grief are you going to get from management for detaining this person?’” one of the former officials said. By that measure, “anybody from Mexico is pretty safe to detain.”

Other than Mexico, all but one of the nationalities with the highest detention rates are from Latin America. These include immigrants from the Northern Triangle of Central America — Guatemala, Honduras, and El Salvador — who in recent years have been entering the country in larger numbers. Immigrants from China are among those with the lowest rates of detention: Less than 1 in 5 Chinese immigrants are imprisoned during deportation proceedings, even though Chinese immigrants make up the fifth-largest undocumented nationality in the U.S.

The data BuzzFeed News analyzed was obtained through a Freedom of Information Request from the Justice Department’s Executive Office of Immigration Review (EOIR). EOIR declined to comment for this story, citing the fact that ICE, part of the Department of Homeland Security, is in charge of detaining immigrants. But ICE declined to respond to questions on the findings because it “is unable to comment on data provided by another federal entity.”

For its analysis, BuzzFeed News examined all removal cases initiated between 2003 and 2014. Because some immigrants are initially detained but subsequently released — often on bond or at the order of an immigration judge — BuzzFeed News counted such cases as detained in order to focus on ICE’s decision. The detention-rate disparities persisted even after controlling for gender, whether the case stemmed from criminal charges, and whether the immigrant had legal representation at the beginning of the case. Five experts reviewed the methodology, which is available here.

Factors not accounted for in the data could influence detention rates. One example: an immigrant’s prior criminal history, which could result in mandatory detention. Other factors include whether an immigrant had been deported before, and demographic traits such as age, wealth, and education. How these factors vary among immigrants of different nationalities facing deportation is unknown. They could explain at least part of the disparity — but probably not all of it, according to the experts consulted by BuzzFeed News. These experts included Michael Wishnie, director of Yale Law School’s immigration clinic; Marc Rosenblum of the Migration Policy Institute; Peter Markowitz of Yeshiva University; and César Cuauhtémoc García Hernández of the University of Denver.

There are many ways for an immigrant to wind up in ICE custody, from being pulled over by a local police department for a traffic violation, to getting arrested for more serious crimes, to being picked up directly by ICE during a workplace raid. The next step is for ICE to choose whether to detain or release an immigrant. If the choice is detention, the immigrant is incarcerated in any one of hundreds of facilities ranging from large private prisons to county jails.

Because many immigrants wind up facing deportation after arrests by local police, disparities in immigrant detention rates could partly reflect policing that targets Latin American immigrants, said César Cuauhtémoc García Hernández, a law professor at the University of Denver who studies criminal and immigration law.

Overall, the immigration enforcement system’s disproportionate focus on Mexicans repeats a historical pattern in which the government focuses on whichever nationalities of immigrants are most numerous and controversial at that moment, said Markowitz of Cardozo Law.

“Germans and Italians experienced that, and so did Chinese immigrants,” Markowitz said. “And Latinos, particularly Mexicans and Central Americans, are today’s focal point.”