A migrant family — a father, mother, and their two young children — arrived at the US-Mexico border last week, after a long journey from their home in Soyapango, in the outskirts of San Salvador. They had fled powerful gangs who made daily life feel oppressive. The father had recently been stabbed.

That was one reason to leave. There was another: They hoped to get better medical care in the US for their son, who was born with heart complications.

“We’re looking for a new life for him. Maybe there can be some treatment for him in the United States,” said the father, 21-year-old Denelson, who worked as a day laborer in El Salvador. He asked to use only his first name only as his US immigration status remains uncertain.

Unlike the record tens of thousands of families and unaccompanied children who are crossing the US border without authorization and then turning themselves in to Border Patrol agents, Denelson and his family did exactly what the Trump administration asked: They waited to enter the US at the official San Ysidro, California, port of entry, then told border officials they wanted to apply for asylum. There, they were subjected to Trump’s new policy, called the Migrant Protection Protocols (MPP), also known as “remain in Mexico.” The policy sends some non-Mexican asylum-seekers back to Mexico until their US immigration cases are resolved, unless they can prove Mexico would be dangerous for them. It was initiated in California in January and has since been expanded to other US ports of entry, including in Calexico, California, and El Paso, Texas.

Because of the MPP, Denelson was sent back to Mexico. But the rest of his family was allowed to stay in the US, as children are exempt from the policy. Denelson also faced another complication: He was unable to prove he was a member of his family as he is not married to his partner and has a different surname than his family.

His first court hearing is scheduled for May 7 in San Diego.

Had the family arrived this week instead of last, they might have all been allowed to stay in the US. A California federal district judge on Monday temporarily blocked the Trump administration from sending people back to Mexico. The preliminary injunction goes into effect Friday at 5 p.m. PT.

Meanwhile, it’s unclear what the ruling means for the hundreds of asylum-seekers who, like Denelson, were already sent back over the border to Mexico to await their hearings. The legal challenge, which was brought by the Innovation Law Lab, American Civil Liberties Union, Southern Poverty Law Center and other civil rights groups, names 11 migrants as plaintiffs. The ruling orders the United States to allow them into the country but does not say anything about those previously returned under the "remain" policy.

“The question is whether we can work out some procedure to get them back to the United States sooner,” says Judy Rabinowitz, deputy director of the ACLU’s Immigrants’ Rights Project. “This may not be such an issue for those who have hearings coming up in the next week or two. But for those who were not scheduled for another hearing until August, that’s a long time to have to wait in Mexico.”

The ACLU is seeking to have returned asylum-seekers present themselves at ports of entry in hopes they will be allowed in this time because of the ruling.

“The government has to agree to some kind of procedure,” Rabinowitz adds.

Monday’s decision was the latest blow to President Donald Trump’s attempt to block Central American asylum-seekers making their way to the border and entering the US. And it had been one of the signature policies of former Homeland Security Secretary Kirstjen Nielsen, who resigned just a day earlier. The White House said it would appeal the ruling, which it characterized as “forcing open borders policies onto an unwilling American populace.”

The complaint, filed last month, argued that the “remain in Mexico” policy violates the humanitarian protections to which asylum-seekers are entitled under US asylum law, international treaty obligations and federal regulations. It also warns that asylum-seekers “face a heightened risk of kidnapping, disappearance, trafficking, sexual assault, and murder, among other harms” in Mexico.

Related: How Ciudad Juárez is bracing for more migrants under US ‘remain in Mexico’ policy

In his 27-page ruling Monday, Judge Richard Seeborg said the legal question “is not whether the MPP is a wise, intelligent, or humane policy, or whether it is the best approach for addressing the circumstances the executive branch contends constitute a crisis.” Rather, he wrote the plaintiffs were probably likely to succeed in showing the MPP violates the Immigration and Nationality Act, the Administrative Procedures Act and other obligations to ensure immigrants “are not returned to unduly dangerous circumstances.”

Indeed, those returned to Mexico are largely on their own. Migrant shelters in border cities such as Tijuana and Ciudad Juárez are have been overwhelmed by large numbers of new arrivals. The cities have received little help from the Mexican federal government — or the US — to implement what Mexico calls a “unilateral” US policy. Asylum-seekers frequently head to shelters only to be told they are at capacity. The dangers in border regions are real: in December, two teenage migrant boys were killed in Tijuana.

Related: After two boys’ murders, migrants and advocates fear ‘remain in Mexico’ policy

“What you’re doing is not only putting people in a place of danger and insecurity … but you’re also making it mostly impossible for them to meaningfully pursue their asylum claims,” Rabinowitz says. “People, when they’re sent back to Mexico, are given lists of attorneys in the United States and they’re told, ‘Call these legal services groups.’ It’s hard enough for people in the United States to get attorneys to represent them for free or low cost. But if you’re in Mexico and you call one of these places, they’re doing to say, ‘Come here. We can’t go to Mexico to help you.’”

Denelson does not have a lawyer yet. Since the US sent him back to Tijuana, he has slept on the streets or in rooms offered by local residents, sharing space with other migrants like him.

He doesn’t have a phone and borrows others’ to make calls. And he has not spoken to his family since they were separated last week.

“Not once,” he says. “We’ve lost contact.”