Defense Secretary Jim Mattis and Homeland Security Secretary Kirstjen Nielsen speak with troops deployed to the Mexico border in Texas. (Reuters)

The Department of Homeland Security asked the Pentagon on Friday for a 45-day extension of the U.S. military presence at the Mexico border, a request that would stretch the deployment until at least the end of January.

The Defense Department is expected to agree to the extension in the coming days, well ahead of the mission’s current expiration date, which is Dec. 15. Pentagon officials have said some of the 6,000 active-duty personnel stationed along the border in Texas, Arizona and California would be brought home and replaced by other units.

President Trump ordered the deployment to preempt the arrival of thousands of Central American migrants traveling in caravan groups and seeking to enter the United States. His administration has characterized the migrants, who have concentrated along Mexico’s border with California, as a grave security threat.

“Given the ongoing threat at our Southern border — today the Department of Homeland Security submitted a request for assistance to the Department of Defense to extend its support through January 31, 2019,” DHS spokeswoman Katie Waldman said in a statement.

“This request refines support to ensure it remains aligned with the current situation, the nature of the mission, and [Customs and Border Protection] operational requirements,” she said.

Pentagon spokesman Jamie Davis confirmed the request.

Homeland Security Secretary Kirstjen Nielsen has also sent a memo to the departments of Justice, State and Interior, among others, requesting backup at the border from their law enforcement personnel. The unusual request, first reported Friday by Politico, would potentially deputize forest rangers, U.S. marshals and other federal officers to work as auxiliary immigration agents.

A Justice Department official, who spoke on the condition of anonymity because the person was not authorized to speak on the record, confirmed Friday that the Drug Enforcement Administration would provide 33 agents, and that the U.S. Marshals Service is sending 11 of its staff to the border in California. Their precise role was not immediately clear, but an official said they would lend assistance at the request of Customs and Border Protection.

U.S. marshals and DEA agents already have a large and active presence along the Mexico border as part of their routine law enforcement duties.

“If the need arises for their services, they’ll be there,” the Justice Department official said. “The caravan presents a unique situation.”

DHS officials said Nielsen’s request did not indicate how many law enforcement officers the agency is seeking, but described the call for help as a unremarkable measure . “In line with the President’s direction and given the very real threat we face at the border from potential mass migration actions — of course, DHS has reached out for assistance from partners across the federal government to defend our sovereignty, protect our frontline men and women, and secure our border,” Waldman said in a statement.

Trump is the first president in a nearly a century to use large numbers of active-duty military personnel at the border, as previous administrations have typically called upon National Guard units to back up U.S. agents during moments of heightened threats or surging migration.

Critics of the administration say the border assignment risks undermining the military’s readiness for more-important missions abroad, and that National Guard troops would be much more appropriate for a domestic mission in support of federal law enforcement.

U.S. law generally prohibits military personnel from performing law enforcement duties on U.S. soil, and the troops stationed there now are supposed to support Customs and Border Protection, not make arrests or detain migrants.

After clashes along the border fence Sunday, DHS officials saw vindication of Trump’s decision to call out the military in the scenes of migrants throwing rocks and attempting to force their way into the United States.

The vast majority of the migrants waiting in Tijuana, Mexico, for a chance to seek asylum in the United States have remained peaceful. But a march by some members of the caravan devolved into a chaotic melee when hundreds of protesting migrants attempted to break through U.S. barriers and others hurled rocks at U.S. authorities, who responded by firing tear gas and pepper-ball rounds.

U.S. troops did not directly engage with migrants at the border, but remained in the rear as a back up, according to DHS officials.

Defense Secretary Jim Mattis told reporters last week that some of the personnel now assigned to the border would be rotated out in the coming weeks.

“Some of those troops certainly will be home [for the holidays], I would anticipate they would be,” Mattis said. “But some troops may not be or some new troops may be assigned to new missions,” he said. “This is a dynamic situation.”

Matt Zapotosky contributed to this report.