Brendan Mullin/U.S. Marine Corps (WASHINGTON) — Days before the midterm elections, President Donald Trump announced the deployment of active duty troops to the southern border to stop caravans of migrants making their way through Mexico.

On Saturday, that original border mission comes to a close, but thousands of U.S. troops will remain for an extended and reduced mission in support of Customs and Border Protection (CBP) slated to last through January 31.

At the height of the deployment, there were 5,900 active duty troops stationed in California, Arizona and Texas. On Thursday, U.S. Northern Command (NORTHCOM) said that figure had dropped to 4,200, but a U.S. official told ABC News that eventually only about 2,500 to 3,000 troops will remain.

The downsizing of the mission comes just days after Trump suggested that the military could be used to build a wall on the southern border. A Pentagon spokesperson said in a statement on Tuesday that there was “no plan to build sections of the wall.”

A troop rotation has been established for the extension, allowing those who were deployed over Thanksgiving to make it home for Christmas, the official said.

The Pentagon has estimated that the original deployment through Dec. 15 would cost taxpayers $72 million, but the extended mission is expected to cost less because of the reduced footprint and the fact that infrastructure is already in place and materials like concertina wire have already been purchased and used.

The focus of the extended mission will be on California, where thousands of migrants fleeing poverty and violence in Central America have arrived in Tijuana with many waiting to apply for asylum.

In late November, a group of migrants attempted to illegally cross the U.S.-Mexico border near the San Ysidro port of entry, prompting CBP agents to use tear gas and close cross-border traffic for several hours. But since that incident, the border has been relatively quiet.

During the six-week deployment, military engineers constructed approximately 70 miles of wire obstacles and placed movable barriers at 22 Ports of Entry across California, Arizona, and Texas, NORTHCOM said. Military Police units, trained to act as back-up for CBP agents in the event of another cross-border skirmish with migrants, conducted more than 10,000 man-hours of unit training.

“With the completion of border hardening missions, some engineering, logistics and headquarters elements will redeploy to their home bases to prepare for other missions,” NORTHCOM said in a tweet on Thursday.

Defense Secretary James Mattis told reporters traveling with him to Ottawa last week that he would leave some engineers in Texas and Arizona “if we ever had to close the ports of entry,” as was done in San Ysidro.

“But a number of these troops will be coming off,” Mattis said, adding, “The missions that are done, they’re coming home.”