"Judicial Activism, by people who know nothing about security and the safety of our citizens, is putting our country in great danger. Not good!" Trump said in a Twitter message on Wednesday.
On Tuesday, a US district judge in San Francisco has blocked a proclamation signed by Trump that bars migrants from applying for asylum if they enter the United States without authorization. The presidential order was challenged by several advocacy groups, including the American Civil Liberties Union.
Trump said that many members of the caravan are indeed criminals and pledged to stop them.
"Catch and detain!" Trump said in opposition the catch and release immigration policy enforced by his predecessor Barack Obama.
READ MORE: Not Your Usual Migrants: Caravan LGBT Couples Conduct Mass Wedding in Tijuana
The Pentagon deployed 5,900 military troops at the southern border to deter migrants from crossing it. The White House allowed the troops to use lethal force against illegal aliens if needed in an order signed late on Tuesday.