LOS ANGELES – President Joe Biden's first immigration crisis has already begun as thousands of families have surged toward the southwestern border in recent weeks, propelled by expectations of a friendlier reception and by a change in Mexican policy that makes it harder for the United States to expel some of the migrants.

More than 1,000 people who had been detained after crossing have been released into the country in recent days, in a swift reversal from the Trump administration's near-shutdown of the border. Many more people are gathering on the Mexican side, aggravating conditions there and testing America's ability and willingness to admit migrants during a pandemic.

New families every day have been collecting in Mexican border towns, sleeping in the streets, under bridges and in dry ditches, according to lawyers and aid groups working along the border. On Thursday in Mexicali, across from Calexico, Calif., desperate migrants could be seen trying to scale a border fence. A migrant camp in Matamoros, Mexico, just across a bridge from Texas, has boomed to 1,000 people over the past few weeks.

To guard against the corona­virus, health authorities in San Diego have arranged housing for hundreds of arriving migrants in a downtown high-rise hotel, where they are being quarantined before being allowed to join family or friends in the interior of the United States.

The surge poses the first major test of Biden's pledge to adopt a more compassionate policy along America's border with Mexico.

The prospect of large numbers of migrants entering the country during a pandemic could create a strong public backlash for Biden as his administration takes steps to undo the strict policies put into place by his predecessor.

A renewed influx would put pressure on immigration courts already straining under a massive backlog of asylum cases. Those who favor more restrictive immigration policies say that migrants who lose their cases could go underground, choosing to remain in the country unlawfully and adding to the estimated 10 million people already living in the United States without legal permission.

"It was predictable that there would be virtually no honeymoon for the Biden administration on the multiple crises that are displacing persons in the Northern Triangle states of Central America and elsewhere," said Donald Kerwin, executive director of the Center for Migration Studies, a nonpartisan think tank.

These include the two hurricanes that destroyed livelihoods and homes in Guatemala and Honduras; the devastating effect of the pandemic on economies across Latin America; and continued gang control of many communities, often accompanied by extortion and violence.

"The Biden administration should be credited with its commitment to address the conditions uprooting Central Americans," Kerwin said, "but this will be a very long-term process, and in the meantime, people have been forced to flee."

Before former President Donald Trump took office, it had been the long-standing practice through several administrations to allow people facing persecution in their home countries to enter the United States and submit petitions for asylum. Some new migrants were held in detention until their cases were decided, while others went free.

Trump derided such policies as "catch and release," and in 2019, he imposed a requirement that applicants wait in Mexico until their asylum requests were approved or denied. Last March, his administration invoked a health emergency law to effectively seal the border during the pandemic except to citizens and legal residents of the United States. Those who attempted to cross were summarily expelled back to Mexico.

But Mexico in recent days has begun enforcing a law passed in November that bars holding children younger than 12 in government custody. As a result, it has stopped accepting Central American families with young children back into Mexico, at least along some stretches of the border with Texas, forcing the United States to keep them. In order to avoid holding large numbers of people in shelters or immigration detention centers during a health crisis, Border Patrol has been releasing some of them to join family and friends across the United States.

Advocacy organizations across the country had been anticipating that the election of Biden would motivate people to head north again. In recent weeks, they have been convening Zoom calls to strategize how to handle the flow.

But the spike came earlier than expected.

Biden said before taking office that he would not immediately open the border, hoping to avoid a rush of migration. On Feb. 2, he signed an executive order that directed a full review of the asylum process, but administration officials have said changes to the existing system would take time to materialize.