WASHINGTON — Active-duty U.S. troops are now stationed inside the Border Patrol's holding facility in Donna, Texas, and monitoring migrant adults and children from just a few feet away, according to two current and two former defense officials, a move a congressman says comes close to violating a 140-year-old federal law.

Despite past assurances from federal officials that the active-duty U.S. troops deployed to the border would not be in direct contact with migrants or be used for law enforcement, the service members stand watch over the migrants. The troops are perched on raised platforms throughout a large room where the migrants are held, according to the four officials.

The troops were assigned to the facility to provide welfare checks on the migrants, but the officials say that has evolved into a continual presence watching over them.

The troops are not armed and are supposed to refer problems to Customs and Border Protection officials rather than interact with the migrants, the officials say, but they are permitted to respond to situations that require immediate medical attention.

Active-duty troops are barred from performing law enforcement functions inside the United States by the Posse Comitatus Act, a federal law enacted in 1878 that prohibits the government from using military forces to act as a police force within U.S. borders.

Rep. John Garamendi, D-Calif., who chairs the House Armed Services Committee's Subcommittee on Readiness, says having active-duty troops monitor migrants is "teetering on the edge of the Posse Comitatus law."

"It's not the role of the U.S. military to be a prison guard," he said. "This is certainly mission creep" and could put U.S. military service members "in a precarious legal situation."

Under federal law, the troops can only support law enforcement, a former U.S. defense official said, and monitoring migrants is "probably a bridge too far."

If they respond to a fight, the former official said, they're playing a different role than is legally permitted. "They should be way behind the fence of the border to help CBP," the ex-official said.

John Cornelio, spokesperson for the U.S. military's Northern Command, said that interaction between the troops and migrants "is limited as much as possible."

"At the Donna facility specifically," Cornelio said, "unarmed military personnel monitor the migrants for signs of medical distress, possibility for unrest, unusual behavior and unresponsiveness. In the event of a medical emergency or other reportable event, our military personnel immediately notify CBP personnel on-site who respond to the incident or event in question."

"Monitoring the wellness of migrants is not a law enforcement function, and this activity has been reviewed by our legal staff to ensure compliance with the Posse Comitatus Act and applicable law. CBP personnel are always present to provide force protection, physical security and perform their law enforcement duties."

A U.S. defense official denies that the troops are guarding the migrants, saying they are monitoring them. The two current and two former officials said the troops are carrying out welfare checks requested by the Department of Homeland Security last spring. The request included deploying 160 service members to the border to transport migrants, 100 to provide meals and conduct welfare checks, 40 for command and control and logistical support, and 20 attorneys.

The troops first began the welfare checks, which they now refer to as wellness checks, at the Donna facility earlier this summer, according to the officials.

The wellness checks are intended to check for responsiveness of migrants or signs of illness, any signs of violence and signs of suspicious behavior.

Initially the checks started with troops walking through the facility every 15 minutes, but troops now stand above the migrants and monitor them constantly.

The DHS and CBP did not immediately respond to requests for comment.