WASHINGTON—The Trump administration plans to begin taking DNA samples from migrants crossing the border or held in detention for use in a federal criminal database, a significant expansion of immigration laws that is certain to raise privacy concerns.

The new rule, posted by the Justice Department on Friday and set to take effect in April, will require immigration officers to collect cheek swabs from what could amount to hundreds of thousands of unauthorized immigrants taken into federal custody each year, including migrants...