A U.S. Marine secures concertina wire on the California-Mexico border at the Otay Mesa Port of Entry in California, Nov. 23, 2018.

The Pentagon has approved a request from the Department of Homeland Security to extend the active duty troops deployed to the southwest border with Mexico.

Secretary of Defense James Mattis extended active-duty troops until Jan. 31 in order to help "harden" the border in response to a caravan of migrants from Central America.

In mid-October, a caravan of at least 3,500 Central American migrants seeking asylum left Honduras for the United States border.

President Donald Trump made the caravan of Central American migrants one of his prime targets ahead of midterm elections. The president has referred to the caravan as an "invasion" while claiming that Democrats want open borders, which Democrats deny.

The movement of thousands of active-duty troops to the border has been criticized as a political stunt designed to back Trump's campaign promise of securing U.S. ports of entry.

Mattis downplayed that criticism in October saying that the Pentagon is providing "practical support based on the request from the commissioner of customs and border police."

"We don't do stunts in this department," he added at the time.

Meanwhile, the Pentagon had estimated that the cost of the 5,900 troops deployed to the southwest border until mid-December would total $72 million.

The cost estimate from the Pentagon came after CNBC learned that the deployment was shaping up to have a price tag of $220 million and that the caravan did not pose a threat to the United States, according to sources with direct knowledge of a U.S. intelligence assessment.

The Department of Defense originally estimated that more than 7,000 troops would take positions in California, Arizona and Texas in support of the Department of Homeland Security and Customs and Border Protection. In which case, the border mission, will have a larger U.S. military footprint than the combined efforts in Iraq and Syria.

WATCH: The economic cost of immigration detention