PIEDRAS NEGRAS, Mexico — An improvised shelter where hundreds of Central American migrants have been confined in the border city of Piedras Negras, across from Eagle Pass, Texas, will close next week, authorities said Saturday.

Coahuila State Public Safety Secretary Jose Luis Pliego said the shelter in an abandoned factory has served its purpose, which was to provide attention to the migrants and process their migratory status.

It is expected to close Wednesday, and authorities have begun taking some migrants to neighboring states such as Nuevo Leon and Tamaulipas to be incorporated into the workforce while others may seek other options to try to cross into the United States.

Pliego said about 1,500 now have papers that let them move freely in Mexico. Some 400 have already been taken to other states, and about 70 were deported to their home countries for purportedly disturbing the peace.

"Given the conditions we have right now, the advances in registrations, the advances in providing documents" and the fact that many who were ill when they arrived have been or are being treated, Pliego said, "the purpose of the shelter has practically concluded."

Soldiers in camouflage and body armor formed a perimeter outside the facility on Saturday, resting casually on riot shields, as migrants milled about on the other side of the yellow chain-link fence. A helicopter buzzed overhead, some boarded buses to be transported elsewhere.

On Wednesday police and migrants scuffled briefly at the building, which was ringed by officers and soldiers, because they were not being allowed outside. Video of the images showed some migrants tearing down a temporary awning and trying to wrestle metal barricades from police.

Some migrants still at the shelter said they were not being allowed to come and go despite holding the permits, and they hope to leave as soon as possible for fear of possible deportation.

"I don't feel safe here," said Donaldo, a Honduran migrant who declined to give his last name for fear of possible reprisals in Mexico or back home. He added that officials had torn up the credentials of some people and that was the cause of the Wednesday's disturbance.

A field officer with the Texas-based refugee advocacy group Raices has spoken of "prison"-like conditions inside.

The migrants have wanted to appear at the U.S. border to apply for asylum, but only about a dozen per day have been allowed to do so.

Pliego said he was aware of another possible migrant caravan from Honduras, but it was not clear where it would head once in Mexico.

Some previous caravans have made for the border city of Tijuana, where there is a long waiting list for asylum seekers to be allowed to present their case.