WASHINGTON—The Justice Department is planning to require collection of DNA from immigrants crossing the U.S.-Mexico border and others in immigration detention for use in a national criminal database.

Senior administration officials said Wednesday a proposed rule requiring the Department of Homeland Security to collect DNA from migrants taken into custody could be published in coming days.

The rule—which injects a new civil-rights issue into the debate about U.S. immigration-policy changes—would require collection of cheek swabs from what could amount to hundreds of thousands of migrants, including unauthorized immigrants taken into Immigration and Customs Enforcement custody.

The move would be a significant expansion of the government’s DNA database, operated by the Federal Bureau of Investigation, that contains samples from people accused of committing serious crimes.

Senior Justice Department officials said the expansion brings the government in better compliance with a 2005 law directing it to collect biometric information from several groups of people, including criminals and unauthorized immigrants, though that law gave the Homeland Security secretary discretion to waive the requirement. The Justice Department officials also said the Trump administration feels compelled to move ahead with the plan because it would help the government better identify immigrants who could commit crimes in the future.