– Pushed beyond their limits by prolonged waits in dangerous and squalid conditions in parts of Northern Mexico, thousands of caravan members who had been waiting to seek asylum in the United States appear to have given up, Mexican officials said, dealing President Donald Trump an apparent win after a humbling week for his immigration agenda.

About 6,000 asylum-seekers who had traveled en masse, many of them in defiance of Trump’s exhortations that they were not welcome, arrived in Northern Mexico in late November as part of a caravan that originated in Honduras. Since then, more than 1,000 have accepted an offer to be returned home by the Mexican government, the officials said. Another 1,000 have decided to stay in Mexico, accepting work permits that were offered to them last fall, at the height of international consternation over how to deal with the growing presence of migrant caravans.

Trump resorted on Friday to declaring a national emergency after he failed to secure funding from Congress for a border wall that he said would block migrants from entering the United States. But the data from Mexican officials suggested that harsh policies he has introduced to crack down on asylum-seekers may already be achieving some of its intended effects.

Added this week to new policies that are bearing down on asylum-seekers — which include tight limits on the number of people who can apply for the status each day and a heightened standard of proof to qualify — was the extension of a rule that certain asylum-seekers must wait in Mexico for the full duration of their legal cases, which can take years.

The requirement originally applied only to adults, but the Department of Homeland Security expanded it to include families with children as well.

Among those who have been dissuaded, at least for now, is Natali, 32, who asked to be identified only by her first name because she feared for her safety. Speaking from her modest apartment atop a steep hill in western Tijuana, she explained that she and her husband had fled their home in El Progreso, Honduras, after she witnessed a killing carried out by a local criminal gang. Soon after, she began to receive threats in the mail warning her to keep quiet.

Once in Mexico, they heard about the increasingly long odds of receiving asylum in the United States, and feared more than anything that officials there would return them to their home country. Rather than crossing the border, they decided to seek humanitarian visas to remain in Mexico legally for at least one year, and have begun to build a life.

She still believes she might ask for asylum in the United States, but is realistic about her chances. “I like Tijuana,” she said. “It’s a very pretty city and there’s a lot of work.”

Mexican officials said the data on people who have deferred or given up their quest for asylum in the United States reinforced an idea that is often raised by Trump: that many caravan members are not truly desperate for protection.

“What happened is that many people came on an adventure, trying their luck,” said Cesar Palencia, Tijuana’s chief of migrant services. “When they realized that it was hard to cross and the conditions in Mexico were also difficult, among many factors, they decided to return home.”

The Honduran caravan ballooned in size as it swept through impoverished villages, drawing national media attention and an eclectic mix of participants. Many came from poverty, lacking education and resources, and said they were unfamiliar with the complex set of laws that would ultimately determine who would be granted legal status in the United States, and who would not.

Immigrant advocates said that hype and false promises had attracted a group that was somewhat unrepresentative of typical asylum-seekers. But they pointed to the roughly 4,000 members who had successfully entered the United States and had at least requested protected status to argue that most had legitimate claims.

Michelle Brané, the director of migrant rights and justice at the Women’s Refugee Commission, warned that while Trump’s tough policies may discourage the undeserving, they might also endanger people who need protection.

“It may look like it’s working in the short term,” Brané said, “But I don’t think it’s a long-term solution. It’s driving people further into the shadows and that’s exactly the opposite of what we want.”