Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

U.S. border agents will soon begin a widespread program to gather DNA samples from immigrants who enter the country illegally and are in federal custody, according to two administration officials.

The officials said the collection effort will fully enforce the DNA Fingerprint Act, a law Congress passed in 2005 that requires taking DNA samples from anyone arrested, facing charges or convicted — and from any non-U.S. citizens "who are detained under the authority of the United States."

Civil liberties groups have criticized the plan since it was first discussed last fall.

"The administration's racist immigration policies will also implicate the right of family members in other countries and family members here, including American citizens," said Vera Eidelman, a staff attorney with the American Civil Liberties Union.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Download the NBC News app for breaking news and politics

The Department of Homeland Security asked for an exemption from the law during the Obama administration, saying it did not have the manpower to gather the samples. But in October, when the Trump administration disclosed its plans to begin gathering immigrants' DNA, it said the process is now easier and cheaper.

In a notice published in the Federal Register, the government said gathering DNA from non-citizens in custody "could be essential to the detection and solution of crimes they may have committed or may commit in the United States" while awaiting deportation proceedings.

A Justice Department official said the failure to collect DNA from immigrants in custody "has allowed subjects accused of violent crimes, including homicide and sexual assault, to avoid detection even when they have been detained multiple times by CBP [Customs and Border Protection] or Immigration and Customs Enforcement."

The DNA material would be sent directly to the FBI to store in its Combined DNA Index System, known as CODIS.

"It will not be used by the Department of Homeland Security" for border enforcement, an administration official said.

The CODIS system is similar to the FBI's massive fingerprint database and is used to help identify suspects based on material recovered at crime scenes.

Since January, Customs and Border Protection agents have carried out a pilot program to collect DNA samples from some migrants apprehended in Detroit and at the Eagle Pass port of entry in southwest Texas.

House Democrats Rashida Tlaib of Michigan and Veronica Escobar and Joaquin Castro of Texas denounced the DNA collection, saying it "reinforces the xenophobic myth that undocumented immigrants are more likely to commit crimes."