Ms. Davis suggested that migrants who had been apprehended and were slated to be released into border towns could instead be taken to one of several sanctuary cities, which limit how local law enforcement can cooperate with federal immigration officers.

The proponents of the idea inside the White House argued at the time that it would help with overcrowding at nonprofit shelters in border towns by transferring the migrants to cities that already embrace the idea of having more immigrants, one official said.

Once there, the migrants would be released onto the streets — potentially sending a message to the Democratic politicians who oppose Mr. Trump’s immigration agenda and his demands for a wall along the border with Mexico.

“The idea has been raised by one to two principals that, if we are unable to build sufficient temporary housing, that caravan members be bused to small- and mid-sized sanctuary cities,” Ms. Davis wrote to the officials at the agencies. She added, “There is not a White House decision on this.”

Matthew Albence, the acting deputy director of ICE, objected to the idea, telling the White House that there would be liability issues if a migrant were injured during transport. He also raised concerns that the agency’s budget had not been appropriated for that purpose.