WASHINGTON—The Trump administration plans to use $271 million of Department of Homeland Security funds, including some designated to help hurricane-stricken areas, to detain and remove immigrants who cross the southern U.S. border illegally.

DHS plans to divert money that lawmakers had designated for other purposes at the agency to increase its capacity to handle people crossing the U.S.-Mexico border, many of whom are Central Americans seeking asylum from violence in their home countries.

“Without...