The Pentagon on Tuesday approved keeping several thousand active-duty troops along the Southwest border at least through January, extending a controversial mission to assist the Border Patrol as it grapples with a surge of migrants seeking asylum.

Defense Secretary James N. Mattis signed the order to continue the mission through Jan. 31, according to a Pentagon statement. The deployment had been due to expire in mid-December.

The order marks another expansion of a military operation that has steadily grown since President Trump rushed soldiers and Marines to border posts shortly before the Nov. 6 midterm election in what critics said was a political stunt, not a national security emergency.

The administration argued that the troops were needed to help block caravans of several thousand Central American migrants then headed north in Mexico and hoping to seek asylum in the United States.