CIUDAD HIDALGO, Mexico—The last time a caravan tried to enter Mexico, the migrants found themselves up against police in riot gear, closed fences, and canisters of tear gas. But there was none of that last week, when members of the latest caravan arrived at the Mexican border.

There was only an offer from Mexican immigration authorities: one-year visas to enter Mexico, with the ability to travel to any part of the country, even the border of the United States. However, it remained unclear whether asylum seekers would be able to enter the U.S. because of the rollout Friday of a new policy that forces people to wait in Mexico until they can return to the U.S. for their court dates. The first asylum seekers affected by the policy were scheduled to be released into Mexico on Friday.

These humanitarian visas are supposed to be issued in about five days, instead of the usual month, opening up a fast track to reach the U.S. by providing legal entry to people who otherwise would have likely traveled undocumented. As applications ballooned, the Mexican response seemed to set up a confrontation with President Donald Trump, who tweeted on Jan. 19: “Mexico is doing NOTHING to stop the Caravan which is now fully formed and heading to the United States.”

The administration of Andrés Manuel López Obrador, the Mexican president who entered office on Dec. 1, had promised to change its immigration policies, since Mexico has traditionally focused on deporting the majority of Central Americans instead of granting them a means of transit. In a week, it has quickly found itself with more than 12,000 migrants in line for permits.

Marcos López Mejia, 29, one of the caravan’s early recipients of the visas, said he had heard of other people from his Honduran port city of Trujillo who had made it to the U.S. border. His newly minted legal status would allow him to save up money to travel on his own, though he is considering waiting for permits to be issued to the thousands of other migrants.

“My plan was to get here and continue with the caravan, without papers, to the border of the United States,” he said. “We used to believe that the safest way to travel was with a smuggler. Now we don’t have to avoid immigration agents, and we can hop from one bus to the next.”

López Mejia had seen Mexico’s past immigration restrictions firsthand. In 2015, he left behind his barber shop and paid a first installment of $1,500 to a smuggler to take him to the United States, only to be deported from southern Mexico, presumably because he had not shelled out enough cash. This December, he made calls to coyotes, but was told it would cost him $11,000 to get to the United States. The price was far too high, so he left for the caravan instead.

Hundreds of visas have been handed out in recent days, but the processing times are slower than originally stated, and in the meantime, people have started to sleep in the parking lot and to string up sheets on the overpass above the Suchiate River, which divides Mexico and Guatemala. It remains unclear whether the plan will disperse the caravan, or if it will eventually backfire, causing the caravan to grow. Limited cash and security concerns may still lead migrants to proceed together, either on foot, hitchhiked vehicles, or donated buses.

“The majority of people are still thinking of getting to the United States. This takes one obstacle out of their way, but it does not get them to their goal,” said Yolanda González Cerdeira, the regional coordinator in Central and North America of the Jesuit Migration Network.

Immigration authorities were unclear last week about whether the visa offer was temporary, but while it lasts migrants from Central America are continuing to arrive at the border with backpacks on their shoulders. The first ones left Honduras on the night of Jan. 14, but many others have followed as news spreads of Mexico’s seemingly open arms.

“Mexico, for at least 30 years, has had a policy of detention and deportation, very much linked to requests from the United States, so this is a complete change in policy and in focus,” said Gretchen Kuhner, the director of the Institute for Women in Migration.

Many of the migrants are fleeing the same conditions as those who crossed Mexico on a caravan that took off from the Honduran city of San Pedro Sula in mid-October. In Honduras, nearly two of every three people live in poverty, with a high incidence of gang- and drug-related violence, especially in urban areas.

But the latest group came with the assurance that the caravan before them had already passed police sent by former Mexican President Enrique Peña Nieto’s administration, then later received assistance from church and advocacy groups, and even government officials. Its undocumented travel had, as a precedent, only a smaller caravan that made it to the northern border city of Tijuana in the spring and other caravans in past years that had made it only to the middle of the country.

“[Government officials] are attempting a radical change in policy, but it’s unclear how they are going to manage, because in Mexico, there were always several barriers to migration, but not directly on the border,” said Ernesto Rodriguez Chavez, a former director of migration studies for the National Institute of Migration, the Mexican government’s immigration authority. “The southern border does not have the infrastructure, the personnel, or the capacity, to process 10,000 to 20,000 people.”

The success of the past caravans, though limited, became a rallying point for many of the newest migrants. Over 6,000 people in the October caravan eventually made it to the city of Tijuana, and some of them either sought asylum at a U.S. port of entry or after jumping over a border fence.

Rodulfo Figueroa, the field office director in Tijuana for Mexico’s National Immigration Institute, said 2,200 people from the past caravan had been granted humanitarian visas, in order to legalize their stay in the city. But many others never even received their permits, in part because they left for other cities or continued on to the United States.

The new permits stand not only to reduce the rate of deportations—last year, Mexico arrested and sent back more than 106,000 people—but also, officials said, to make migration safer. Risks of traveling clandestinely have included kidnapping, assault, and extortion. Even the caravans did not guarantee protections: Two teenage boys were murdered in Tijuana in December.

Though the rate of applications for asylum in Mexico have increased in recent years, most migrants have their eyes set on the U.S., citing security concerns in high-crime areas in Mexico, the earning potential in the U.S., and a history of migration that has left them with many more relatives in the United States than in Mexico.

Juan Manuel Flores Munguia, 23, from Tocoa, Honduras, said he had started an asylum application in Mexico, but the process could take three to six months. He left Honduras after a man shot his brother in both legs at a soccer game. When the caravan arrived, he went with his wife and two children to wait in line for the visa, hoping for a shorter wait time.

“The president here is helping us, but our own president has not at all,” Flores Munguia said. “I’ll be killed if I go back to my country.”

The development projects that Mexico has established, in part to get migrants to stay in southern states, include the construction of a train line and a reforestation project. But according to migration experts, it is hard for new jobs to convince people with relatives they would be better off in Mexico. Flores Mungia, for example, has a grandmother, uncle, and cousins waiting to receive him in the U.S.

“That’s not going to reduce dramatically the number of people who see the U.S. as their primary destination, in part because of an economic difference, of salaries between the U.S. and Mexico, and because they have families in the U.S. That’s a key factor,” said Maureen Meyer, the director of the Washington Office on Latin America’s Mexico program.

Mexican authorities, however, have focused on getting migrants to remain in their country. In December, the government announced that it was planning a $30 billion initiative for development in southern states, which would help provide jobs for Central Americans. The humanitarian visas currently being handed out give migrants the chance to work in Mexico and receive care in public hospitals, and they are renewable after the first year. On Wednesday, the Mexican government announced the expansion of another form of entry, one-year work permits that had previously been given only to Guatemalans and Belizeans, but would now also be granted to Salvadorans and Honduras for work in any of seven states.

But it has also contemplated more drastic measures. In December, the U.S. Department of Homeland Security announced a plan—which remains in negotiation—to have all asylum-seekers wait in Mexico for the duration of their U.S. asylum cases, and Mexico’s foreign ministry agreed.

Civil society discussions have raised concerns about how the latest announcements fit in with these bilateral discussions. Biometric data, including fingerprints and iris scans, is being collected as part of the registration process for humanitarian visas. Since 2008, the U.S. has had access to the data of migrants held in Mexican detention centers, but not of everyone else who has passed through the country undetected.

For now, the consequences of Mexico’s experiment remain unclear, but the daily line of migrants stretches nearly to the Guatemalan end of the overpass. Others wait on the sidelines for their small green visas to be issued and their names to be called.

“To what extent can they continue with this plan to give people legal status if it’s going to give others an incentive to come?” said Quique Vidal Olascoaga, a coordinator for the Fray Matías de Córdova Center for Human Rights. “There has to be a limit.”