Earlier, 5,900 troops were deployed along the US-Mexico border to help stop a caravan of several thousand would-be migrants from Central America trekking their way through Mexico toward the US.

"If we find that it gets to a level where we are going to lose control or where people are going to start getting hurt, we will close entry into the country for a period of time until we can get it under control," Donald Trump said, speaking to reporters after a Thanksgiving phone call with members of the military.

Asked to clarify whether he meant closing the whole border or just part of it, Trump confirmed that he meant the whole border. "I mean the whole border. Mexico will not be able to sell their cars into the United States where they make so many cars at great benefit to them, not a great benefit to us, by the way," he said, speaking from his Mar-a-Lago home on Thursday.

Trump also confirmed that he has given US troops the okay to use "lethal force" if necessary to deal with some of the "tremendously dangerous" people in the migrant caravan, who he said have already engaged in mass violence in Mexico. "You have many criminals in that caravan, and the big caravan hasn't arrived yet," the president said.

Nevertheless, Trump said that the border was "fortified" with fencing, walls and other measures to prevent the caravan from getting through. "They're not coming through. We're not letting criminals into our country. You gotta come in legally, you have to come in through a process," he said. "We need workers, but they have to come in legally. We want them to come in, but they have to be people that want to work and want to do a great job for our country. They come in through a merit system," he added, accusing the Democrats of wanting open borders.

Trump added that there could be another government shutdown in December if a bipartisan agreement on the border security issue was not found. "It could happen. Over border security. The wall is just a part of border security, a very important part, probably the most important part," he said.

In his remarks, Trump also complained about a federal appeals court in California after it blocked a presidential order on asylum, calling the court "a big thorn in our side." The president promised to appeal the "ridiculous" ruling, which he said "makes the job harder" and "more dangerous."

"It's a terrible thing when judges take over your protective services, when they tell you how to protect your border. It's a disgrace," he said. "Large numbers of people and in many cases we have no idea who they are. In many cases they're not good people. They're bad people. But large numbers of people are forming at our border," the president said.

Earlier this week, Mexican media reported that at least 600 individuals from the Central American migrant caravan had been detained by Mexican authorities after refusing to apply for permission to stay in Mexico.

The US military deployed 5,900 troops to its southern border earlier this month to beef up border patrol efforts, with the White House okaying the use of lethal force if necessary on Tuesday. The Mexican Interior Ministry estimates that the migrant caravan numbers approximately 5,600 people, with about 2,600 of them staying near Tijuana, with another 3,000 staying near Mexicali. Both cities are situated in northwest Mexico.