Nearly two dozen immigrants were allowed to cross the U.S.-Mexico border to seek asylum on Tuesday, the day the Trump administration planned to launch a drastic policy change designed to end asylum protections for most migrants who travel through another country to reach the United States.

The administration announced the plans a day earlier, reversing decades of U.S. policy in its most forceful attempt yet to slash the number of people seeking asylum in America. The new rule would cover countless would-be refugees, many of them fleeing violence and poverty in Central America. It is certain to face legal challenges.

At the crossing in Tijuana, Mexico, two asylum seekers who work closely with Mexican authorities called 12 people whose numbers were first on a waiting list to enter the through a San Diego border crossing. They were escorted behind a metal gate to a white van that left minutes later to turn them over to US authorities.

At another crossing in Juarez, Mexico, 10 Cuban asylum seekers were called by Mexican officials and led across the Paso Del Norte Bridge to El Paso, where they were handed over to Customs and Border Protection officers, who began to process them. They were taken to a room where their possessions were searched, laid out on a table and bagged.

The few people who were allowed to cross were picked from many more immigrants who lined up at crossings. It’s unclear how officials will process their asylum claims under the new system. Lawyers who represent Cuban migrants say that they are not deportable because Cuba will not accept them.

“I’d rather be in prison the rest of my life than go back to Cuba,” said Dileber Urrista Sanchez, who had hoped his number would be called Tuesday, but he was further down the list.

Sanchez, 35, has waited with his wife in Juarez for the past two months, renting a room with money his mother sends him from Las Vegas.

He said his mother left Cuba years ago because she was part of an opposition party. In retaliation, he said, the government took away his job as a chauffeur, and he and his wife had been imprisoned for days at a time for being “untrustworthy.”

He criticized the Trump administration’s new policy, pointing out that the first country he was able to reach after leaving Cuba was Nicaragua.

“How are we going to apply for asylum in Nicaragua when it’s just as communist?” he said.

Derek Mbi of Cameroon was among nearly 50 migrants who gathered in Tijuana. He arrived there about a month ago, and more than 8,100 people were ahead of him on the waiting list.

Processing new arrivals has ground to a virtual halt to in recent days, down from an average of about 40 names a day.

Mbi, 29, joined a wave of Cameroonians who fled fierce government oppression against their country’s English-speaking minority by flying to Ecuador, which does not require a visa. From there, he traveled for months by bus and on foot through seven other countries to reach Tijuana.

Mbi learned about the new policy but mistakenly believed that it applied only to Central and South Americans. He hopes to settle with a friend in Texas.

For now, he is sharing a one-bedroom apartment with 13 Cameroonians in Tijuana and scraping by with odd jobs, like peeling tomatoes at open-air markets. He said many companies refused to hire him because his short-term transit permit in Mexico does not allow him to work.

Mbi declined to discuss why he fled Cameroon.

According to the plan published in the Federal Register, migrants who pass through another country — in this case, Mexico — on their way to the U.S. will be ineligible for asylum. The rule also applies to children who have crossed the border alone.

The vast majority of people affected by the rule are from Central America. But sometimes migrants from Africa, Cuba or Haiti and other countries also try to come through the border.

There are some exceptions, including for victims of human trafficking and asylum-seekers who were denied protection in another country. If the country the migrant passed through did not sign one of the major international treaties governing how refugees are managed (though most Western countries signed them), a migrant could still apply for U.S. asylum.

Trump administration officials say the changes are meant to close the gap between the initial asylum screening that most people pass and the final decision on asylum, which most people are denied.

But immigrant rights groups, religious leaders and humanitarian groups have said the policies amount to a cruel effort to keep immigrants out. Guatemala, Honduras and El Salvador are poor countries, often wracked by violence.

The new rule also will apply to the initial asylum screening, known as a “credible fear” interview, at which migrants must prove they have credible fears of returning to their home country. It applies to migrants who are arriving to the U.S., not those who are already in the country.

Along with the administration’s recent effort to send asylum seekers back over the border, Trump has tried to deny asylum to anyone crossing the border illegally and restrict who can claim asylum. The attorney general recently tried to keep thousands of asylum seekers detained while their cases play out.

Nearly all of those efforts have been blocked by courts.

Spagat reported from Tijuana, Mexico. Associated Press writers Cedar Attanasio in Ciudad Juarez, Mexico, and Colleen Long and Michael Balsamo in Washington contributed to this report.