The deployment of as many as 15,000 troops to the U.S.-Mexico border — potentially equal in size to the U.S. troop presence in Afghanistan — occurs as the budgetary largesse the military has enjoyed since Trump took office looks set to come to an end.

Although the costs of the border deployments will be a tiny slice of a $716 billion annual defense budget, they arrive as the Trump administration is calling on the Pentagon to cut unnecessary expenditures. The White House recently ordered the Pentagon to slash next year’s budget for the military by about $33 billion in response to the largest increase in the federal deficit in six years.

Veterans and Democratic lawmakers have complained that Trump is wasting military dollars in a politically motivated stunt ahead of Tuesday’s midterm elections, at a time when the Pentagon budget is under pressure.

“Instead of working in a bipartisan manner to make comprehensive, common-sense, and humane reforms to our immigration system, the President continues to turn to politically-motivated fear mongering and uses [Department of Defense] resources and personnel as a means to drive his troubling anti-immigration agenda,” more than 100 House Democrats wrote in a letter to Defense Secretary Jim Mattis on Nov. 1.

Retired Gen. Martin Dempsey, former chairman of the Joint Chiefs of Staff, described the deployment as “wasteful” in a message on Twitter and said Marines and soldiers were already overstretched.

Administration officials have defended the deployment. Mattis said this week that the military doesn’t do stunts. The commissioner of Customs and Border Protection, Kevin McAleenan, argued that the deployment is necessary to “effectively and safely” handle the possible arrival of as many as 7,000 migrants walking toward the border in caravans from Central America.

But military planning documents, dated Oct. 27 and published by Newsweek, predicted that only 20 percent of the migrants, or about 1,400 at the higher end of estimates, were likely to complete the journey to the border, raising questions about the size of the deployment.

“The military has a lot of things that it needs to be doing these days,” said Susanna Blume, a former Pentagon official and senior fellow at the Center for a New American Security. “Looking at estimates of the size of the caravan, you could ask the question as to whether this is the most appropriate use of U.S. active-duty forces.”

It isn’t clear how many U.S. troops will end up on the U.S.-Mexico border.

About 2,000 forces from the National Guard are already there, operating under an order Trump issued in April. Northern Command has said more than 7,000 additional active-duty troops will join them in Arizona, Texas and California. Trump said this week that he will be deploying between 10,000 and 15,000 troops but didn’t make clear whether those figures included the National Guard.

The cost of the National Guard deployment from April 10 through Sept. 30 amounted to $103 million, according to Pentagon figures. The Defense Department expects the Guard deployment to cost an additional $308 million through the end of next September, including the last quarter of 2018, as long as the operations continue apace.

Active-duty forces, which Trump deployed under his recent order, generally are less expensive because they don’t require additional pay or benefits.

Travis Sharp, a research fellow at the Center for Strategic and Budget Assessments, estimated that the cost of deploying 8,000 active-duty troops through mid-December in addition to the Guard would amount to $40 million to $50 million. Should the administration deploy 15,000 active-duty troops, as Trump suggested, the estimated cost would rise to as much as $110 million, Sharp said.

The forces could end up staying past mid-December, depending on the status of the caravans, which by most accounts are still weeks away from the border. An extension of the deployment could result in costs in excess of those estimates.

As of Saturday morning, about 3,500 active-duty service members have been deployed as a part of the mission, dubbed Operation Faithful Patriot, said Maj. Mark Lazane, a Northern Command spokesman. They include about 2,250 in Texas, 1,100 in California and 170 in Arizona, he said.

Photographs taken Friday at the port of entry in Hidalgo, Tex., show U.S. soldiers stringing concertina wire while working with CBP. The soldiers are wearing standard camouflage uniforms along with body armor and helmets, and appear unarmed.

Lazane said soldiers who do not typically use firearms in their day-to-day jobs while stateside will continue to work without them, though Gen. Terrence O’Shaughnessy, the chief of Northern Command, has the authority to change that if desired.

Democrats have complained that in addition to paying for the border deployments, the Defense Department internally allocated $7.5 million to advanced planning for a 37-mile barrier along the side of a military bombing range in Arizona that abuts the border. Democratic lawmakers said the barrier alone could cost as much as $450 million.

Mattis offered a safety justification for the barrier in testimony to Congress earlier this year, suggesting that any migrants crossing the border through the range could end up hurt. Critics have said the project amounts to a move by the president to build part of the border wall he promised on the campaign trail by tapping military resources.

Deputy Defense Secretary Patrick M. Shanahan said last week that the White House had instructed the Pentagon to prepare a $700 billion budget for 2020 — about 4.5 percent less than the $733 billion the department had planned.

Thomas Spoehr, a retired Army lieutenant general and director of the Heritage Foundation’s Center for National Defense, said many of the units deploying to the border are fulfilling duties approximate to their wartime missions and could end up with good training from the field. He said the expenditure would be marginal in terms of the overall American defense budget.

“The military needs every dollar it can get. Having said that, this is not in the scheme of things a huge thing,” Spoehr said. “It probably will pass almost unnoticed in terms of the budget.”