WASHINGTON (AP) — The Trump administration is planning to collect DNA samples from asylum-seekers and other migrants detained by immigration officials and will add the information to a massive FBI database used by law enforcement hunting for criminals, a Justice Department official said.

The Justice Department on Monday issued amended regulations that would mandate DNA collection for almost all migrants who cross between official entry points and are held even temporarily.

The official said the rules would not apply to legal permanent residents or anyone entering the U.S. legally, and children under 14 are exempt, but it’s unclear whether asylum-seekers who come through official crossings will be exempt.

The official spoke to The Associated Press on the condition of anonymity before the regulations were published.

Homeland Security officials gave a broad outline of the plan to expand DNA collection at the border two weeks ago, but it was unclear then whether asylum-seekers would be included or when it would begin.

The new policy would allow the government to amass a trove of biometric data on hundreds of thousands of migrants, raising major privacy concerns and questions about whether such data should be compelled even when a person is not suspected of a crime other than crossing the border illegally. Civil rights groups already have expressed concerns that data could be misused, and the new policy is likely to lead to legal action.

Justice officials hope to have a pilot program in place shortly after the 20-day comment period ends and expand from there, the official said. The new regulations are effective Tuesday.

Trump administration officials say they hope to solve more crimes committed by immigrants through the increased collection of DNA from a group that can often slip through the cracks. The Justice official also said it would be a deterrent — the latest step aimed at discouraging migrants from trying to enter the United States between official crossings by adding hurdles to the immigration process.

Currently, officials collect DNA on a much more limited basis — when a migrant is prosecuted in federal court for a criminal offense. That includes illegal crossing, a charge that has affected mostly single adults. Those accompanied by children generally aren’t prosecuted because children can’t be detained.

President Donald Trump and others in his administration often single out crimes committed by immigrants as a reason for stricter border control. But multiple studies have found that people in the United States illegally are less likely to commit crime than U.S. citizens, and legal immigrants are even less likely to do so.

For example, a study last year in the journal Criminology found that from 1990 through 2014, states with bigger shares of migrants have lower crime rates.

Alex Nowrasteh, director of immigration studies at the Libertarian think tank Cato Institute, which has also studied the issue, said it was unnecessary.

“Fingerprints and current biometrics are more than sufficient to identify criminals and keep them out of the United States. Collecting DNA is expensive, will be done poorly, and doesn’t make Americans any safer,” he said.

Immigrant rights advocates were immediately critical.

“This proposed change in policy is ... transparently xenophobic in its intention,” said American Civil Liberties Union senior policy and advocacy attorney Naureen Shah.

“It seeks to miscast these individuals, many of whom are seeking a better life or safety, as threats to the country’s security.”

Curbing immigration is Trump’s signature issue, but his administration has struggled in dealing with the surge of people trying to enter the United States, mostly Central American families fleeing poverty and violence.

Authorities made more than 810,000 arrests at the border during the budget year that just ended in September, a high not seen for more than 10 years. Officials say numbers have since fallen following crackdowns, changes in asylum regulations and agreements with Central American countries, but they remain higher than in previous years.

DNA profile collection is allowed under a law expanded in 2009 to require that any adult arrested for a federal crime provide a DNA sample. At least 23 states require DNA testing, but some occur after a suspect is convicted of a crime.

The FBI database, known as the Combined DNA Index System, has nearly 14 million convicted offender profiles, plus 3.6 million arrestee profiles, and 966,782 forensic profiles as of August 2019. The profiles in the database do not contain names or other personal identifiers to protect privacy; only an agency identifier, specimen identification number and DNA lab associated with the analysis. That way, when people aren’t a match, their identification isn’t exposed.

The only way to get a profile out of the system is to request through an attorney that it be removed.

Federal and state investigators use the system to match DNA in crimes they are trying to solve. As of August 2019, the database produced about 480,000 hits, or matches with law enforcement seeking crime scene data, and assisted in more than 469,000 investigations.

Justice Department officials are striking a line in the regulations that gave the secretary of Homeland Security discretion to opt out of collecting DNA from immigrants because of resource limitations or operational hurdles.

Justice and Homeland Security officials are still working out details, but cheek swab kits would be provided by the FBI, the official said. The FBI will help train border officials on how to get a sample, which shouldn’t take more than a few minutes.

Customs and Border Protection already collects fingerprints on everyone over 14 in its custody.

The new regulations will apply to adults who cross the border illegally and are briefly detained by Customs and Border Protection, or for a longer period by Immigration and Customs Enforcement.

Those who come to official crossings and are considered inadmissible and not further detained will be exempt. Other exceptions are being worked out, the official said.

More than 51,000 detainees are in ICE custody. Border Patrol custody fluctuates its facilities only hold migrants until they are processed and either released or sent to ICE custody. At the height, more than 19,000 people were held. Recently it was down to fewer than 4,000.

The Justice Department charged the highest number of immigration-related offenses last year since the office began keeping the records: 25,426 with felony illegal re-entry and 80,866 with misdemeanor improper entry into the country.