Defense Secretary Jim Mattis signed a request from the Department of Homeland Security on Tuesday to extend a deployment to the Southwest border through next year as federal agents continue working to stop the illegal entry of thousands of Central American migrants into the United States.

“The Secretary of Defense has approved an extension of the ongoing Department of Defense (DoD) support to the Department of Homeland Security (DHS) response to migrant caravan arrivals. DoD support to DHS is authorized until Jan. 31, 2019,” the Pentagon said in a statement.

Mattis said Saturday that the military’s engineer work to put in crowd control capabilities was completed but indicated there were other things with which troops could assist the DHS. He said no troops were serving in a law enforcement capacity, in compliance with the U.S. Constitution.

“I’ll make certain that what we’re doing is appropriate for our troops, and if it is and Border Patrol needs the help, of course, we’ll provide it,” he said Saturday at the Reagan Defense Forum in California.

“We’ll stay strictly within the Constitution, strictly within our laws, and the law enforcement functions will be carried out by the appropriate people, either the Border Patrol or U.S. marshals or other federal police, but not by the U.S. military,” he said.

Mattis, who has come under criticism for agreeing to deploy troops to the border, has highlighted how previous Presidents Bill Clinton, George W. Bush, and Barack Obama also deployed troops to the border to control illegal immigration.

“Look back to when President Bush put troops there. The longest duration deployment of federal troops on the border were under President Obama; seven years they were deployed there,” he said.

In late November, Mattis gave reporters a lengthy summary of how the previous presidents used troops at the border.

He said President Clinton ordered both troops and military equipment to the border for Operation Gatekeeper in 1994.

“We had troops down there, and their mission was to stem the flow of illegal immigration. So that is under President Clinton Operation Gatekeeper, and we also had active duty, Title 10 federal forces down there,” he said.

“I was a regimental commander in 1994 to ’96. And I had troops on the border; they were in observation post. And when people tried to get over the border, they would pick up the radio, call the Border Patrol, guide them in with their binoculars, okay — or their night vision goggles. ‘They’re in the next gully over,’ and the Border Patrol would do it.

“Most of the people down there never saw the U.S. military that was guiding the Border Patrol at that time, Operation Gatekeeper,” he said.

He said President Bush then had thousands of National Guardsmen along the southern and northern borders from 2006 to 2008.

“The President Bush in 2006 to 2008 had thousands of National Guardsmen down there, and that was on both borders. And the reason it was on both borders, of course, was the terrorist threat at that time,” he said.

“President Obama, of course, had the longest of the troop durations on the border, 2010 to 2017. That was 1,200 National Guard. They were there on border security, was their mission,” he said.

He pointed out that Democrat members of Congress in 1997 wanted to authorize up to 10,000 troops at the border to limit illegal entry.

“It was a very hot debate in the Congress if you go back and look at it. It was ultimately unsuccessful. One of the individuals sponsoring it, a gentleman by the name of Traficant, went to jail during that period. But what was interesting to me as I read about it was both Republicans and Democrats were for it and against it at the same time,” he said.

“Both parties’ presidents have actually used this sort of a remedy,” he said.

He said that ultimately, it is up to the American public and Congress to fix immigration law.

“It’s ultimately up to the American people, though, and the Congress to resolve the laws [and] settle those things. I don’t think we should leave it on the backs of the young lady or male border patrolmen down there who’s got to sort it out on the border because we’ve had some kind of ambivalence up here,” he said.