Defense Secretary Jim Mattis emphatically denied a reporter's suggestion Wednesday that the deployment of thousands of active-duty troops to the U.S.-Mexico border is part of a political stunt ahead of next week's midterm elections.

"We don't do stunts in this department. Thank you," Mattis told a reporter who posed the question after a Pentagon meeting with Mattis' South Korean counterpart. The defense secretary added the deployment was to provide "practical support" to the Department of Homeland Security and was based on a request from U.S. Customs and Border Protection.

The deployment is in response to the approach of a caravan containing an estimated 4,000 Central American migrants. The Pentagon said late Wednesday that it had identified 7,000 who will be participating in the mission at the border. Approximately 2,000 National Guard members previously have been dispatched to the frontier over the past six months.

The White House repeatedly has warned members of the caravan that they will not be allowed into the United States. In an interview with Fox News' "The Ingraham Angle" Monday night, President Trump vowed that the migrants "are not coming in" and said the administration would build "tent cities" to house asylum-seekers.

"We're going to have tents, they're going to be very nice and they're going to wait and if they don't get asylum, they get out," the president said.

TOTAL IMMIGRATION TO U.S. RECENTLY TIED ALL-TIME RECORD

On Wednesday, Trump told reporters at the White House that "anywhere between 10 and 15,000 military personnel" could be sent to the border, "on top of Border Patrol, ICE and everybody else at the border."

Federal law prohibits the military from acting as a domestic police force, which means the troops going to the border cannot detain immigrants, seize drugs from smugglers or have any direct involvement in stopping the caravan. Instead, their role largely will mirror that of the existing National Guard troops, including providing helicopter support for border missions, installing concrete barriers and repairing and maintaining vehicles.

MIGRANT CARAVAN 'MORE SOPHISTICATED' THAN PAST GROUPS, HOMAN SAYS

The new troops are set to include military police, combat engineers and helicopter companies equipped with advanced technology to help detect people at night.

Fox News' Lucas Tomlinson and The Associated Press contributed to this report.