WASHINGTON — The Pentagon is moving to loosen rules that bar U.S. soldiers from interacting with migrants on the southern border and to send up to 300 more troops to help authorities process migrants who cross the border seeking asylum.

The move expands the Pentagon’s role along the border, authorizing troops to be in direct contact with migrants on a regular basis for the first time since President Trump ordered about 5,000 active-duty military personnel to the border in October, days before the midterm election.

The new troops will include military lawyers who can help Customs and Border Protection agents process migrants, drivers to help transport detained migrants and cooks to provide meals for them.

Acting Defense Secretary Patrick Shanahan was expected to authorize the change at the request of the Department of Homeland Security. About 4,900 active-duty and National Guard troops are deployed on the border.

The additional troops will work under Customs and Border Protection supervision to avoid violating the Posse Comitatus Act, which bars the military from doing law enforcement in most circumstances on U.S. soil, according to an official familiar with the draft order.

Critics said the military’s expanding role pushes the boundaries of that law, however.

“This order would take an unprecedented step toward creating an active domestic military force,” Rep. Ro Khanna(D-Fremont) tweeted Friday. “I urge acting Defense Sec. Shanahan to abandon this ill-fated plan.”

The border operation “is at its very heart domestic law enforcement. They are there to enforce U.S. immigration law,” said David Lapan, a former senior official in the Department of Homeland Security. “So what exactly are these additional military forces going to be doing, and how is it not a violation of the law?”

Military lawyers, he added, don’t have experience with immigration law and most don’t speak Spanish, unlike Border Patrol agents, for whom it is required.

Though relatively limited in number and scope, the move could escalate military involvement with migrants at the border.

Until now, troops have helped build border barriers, conducted surveillance, flown helicopters and performed other support duties. They are not allowed to detain migrants, seize drugs or carry out law enforcement duties.

In November, officials said the troops had expanded authority to help protect Border Patrol agents and other U.S. personnel, and could use deadly force in their defense if necessary. No such cases are known to have occurred.

James N. Mattis, who quit as secretary of Defense in December, was wary of expanding the military’s role further. Shanahan, his temporary replacement, has resisted pressure to involve the military in housing migrants or allowing troops to take exclusive custody of them, said the official familiar with the plan.

“We’re not going to house. We’re not going to maintain custody. That’s not part of this deal,” the official added.

On April 9, Shanahan approved a request from the Health and Human Services Department, charged with caring for detained migrant children and families, to identify locations to house up to 5,000 unaccompanied children. The sites have yet to be identified.

Trump has called for a “tougher” approach to illegal immigration and been frustrated by rules barring troops’ direct interaction with migrants. Despite his attempts to crack down, migrant flows have increased sharply in recent months.

In March, U.S. immigration authorities apprehended nearly 93,000 migrants at the border, the highest monthly total in more than a decade. Most were families and asylum seekers from Central America.

Trump vowed to send more troops to the border in response to the surge, saying at a Texas fundraiser, “Our military, don’t forget, can’t act like a military would act because if they got a little rough, everybody would go crazy.”

On Wednesday, he mischaracterized an encounter at the border between several Army troops and members of the Mexican military. “We are now sending ARMED SOLDIERS to the Border,” he tweeted.

The use of military lawyers to help process migrants’ asylum claims, or drivers to transport them, requires Shanahan to waive a 2006 policy that bars military personnel from directly interacting with migrants.

The Pentagon previously approved a waiver to allow the troops to provide emergency medical care to migrants, according to the Washington Post, which first reported Shanahan’s move.

Mark Morgan, who led the Border Patrol for the last six months of the Obama administration, said the Pentagon move would help free up overburdened border agents.

Up to 40% of Border Patrol agents — “highly trained gun-toters,” as he termed them — have been pulled off normal duties to help with logistics, humanitarian aid and “essentially child-care services” as thousands of families seek asylum.

U.S. troops can “fill roles that are needed and let the Border Patrol be on the front lines, rather than the troops.... I think that makes sense.”