President Donald Trump has enacted a sweeping purge of his top officials at the Department of Homeland Security as the number of migrants crossing the border has surged.

The staffing shakeup comes amid news reports that Trump had urged his officials to implement policies that would violate US law or run afoul of court orders, such as making migrants request asylum in their home countries or separating families again.

Experts say whoever replaces DHS Secretary Kirstjen Nielsen will likely face pressure to enact those policies, and that the court system will ultimately strike them down. Here's what they think will happen next.

Visit BusinessInsider.com for more stories.

President Donald Trump has purged multiple top officials from the Department of Homeland Security in recent days, enraged over the skyrocketing number of migrant families seeking asylum in the United States.

But his frustration with the border situation can't easily be solved by simply replacing top officials. Legal experts who spoke to INSIDER are mixed over whether a new crop of officials will make a difference in enacting Trump's agenda, but they agreed that Trump will face the same hurdle no matter who he nominates: the law.

On Sunday, Homeland Security Secretary Kirstjen Nielsen resigned, reportedly at Trump's insistence, amid a surge of border-crossings that topped 100,000 in March. Nielsen had previously infuriated Trump by telling him his idea to shut down the ports of entry wouldn't stop the migrants from entering, and that reinstating family separations or denying entry to asylum-seekers would be illegal, according to CNN.

On Tuesday, Nielsen announced that the department's acting deputy secretary, Claire Grady, had also resigned. Grady has 28 years of experience at DHS and the Department of Defense, and had been next in line to take over as acting Homeland Security Secretary. Instead, Trump has tapped Customs and Border Protection Commissioner Kevin McAleenan to replace Nielsen.

Read more: Kirstjen Nielsen's departure as Homeland Security chief comes amid Trump's increasingly harsh border crackdown

Her resignation came shortly after Trump withdrew his nomination of Ronald Vitiello for Immigration and Customs Enforcement director, saying he wanted to go in a "tougher direction." Rumors even began circulating this week that Trump will force out L. Francis Cissna, the director of US Citizenship and Immigration Services, the agency that processes most immigrants.

But Nielsen, Vitiello, and Cissna aren't known for being soft on immigration. Rather, all three have reputations as hawks, and largely shared Trump's agenda and acted aggressively in their various roles within the immigration system.

That means Trump's border problem goes beyond personnel, Alex Nowrasteh, a senior policy analyst at the libertarian Cato Institute, told INSIDER.

"The law is the biggest obstacle to Trump implementing many of his favorite policies on the border," Nowrasteh. "He can replace the head of DHS with whomever he likes, but the courts will continue to strike down illegal policies."

'Can it get worse from here?'

U.S. Customs and Border Protection Commissioner Kevin McAleenan pauses while speaking during a hearing of the Senate Judiciary Committee, Wednesday, March 6, 2019, in Washington. Associated Press/Alex Brandon

The man Trump has named acting Homeland Security Secretary, Kevin McAleenan, is the current Customs and Border Protection commissioner and is respected by both Republicans and Democrats. He's even been vocal about issues like providing aid to Central America as a way to decrease the number of people fleeing the impoverished countries. Trump has vowed to cut such aid.

But he — or whomever Trump nominates as the next DHS chief — may encounter the same failure Nielsen did if Trump continues to demand policies that violate the law.

"[McAleenan] is a deeply serious man, he's a man who thinks about policies and impact and numbers and statistics and things of that sort," Aaron Reichlin-Melnick, a policy analyst at the American Immigration Council, told INSIDER. "Whether he is going to be the same as Nielsen remains to be seen, but from all appearances, the next secretary is going to have to deal with a lot of pressure from the White House to make changes."

The Trump administration can't re-implement large-scale family separations without violating a federal court order, and it can't block migrants from entering the country to seek asylum without running afoul of US law.

But one of the remaining options to deter migrants is an idea called "binary choice," which would present migrant parents with an option at the border: be detained indefinitely while their asylum cases are processed, or be separated so that the child doesn't have to stay in custody while the parent is detained.

Undocumented migrants wait for asylum hearings outside of the port of entry in Tijuana, Mexico on Monday, June 18, 2018. Getty Images

Read more: Trump mocks asylum-seekers at the border, says they 'look like they should be fighting for the UFC'

According to The Washington Post, DHS officials are mulling the option as a way to meet Trump's demand to get "tough" on immigration and end what he has disdainfully referred to as "catch and release," the practice of releasing migrants into the US while their cases go through the court system, potentially allowing them to vanish.

"I think it's fair to say that binary choice has never gone off the table," Reichlin-Melnick said. "Binary choice has been on the table ever since family separation ended."

But the true test of the next Homeland Security secretary may not be the toughness of their policies, but the strength of the legal challenges against them, according to Karla McKanders, a law professor and Immigration Practice Clinic director at Vanderbilt University.

"I do remain apprehensive about the president firing Nielsen, especially with the legacy that she's leaving behind — of child separation, locking children in cages, children being held in tent cities," McKanders told INSIDER. "I think the question a lot of people have is, 'Can it get worse from here?' And how much litigation will need to be filed to block any further policies that undermine the basic rule of law?"

That doesn't necessarily mean that the status quo at the border will remain intact. But the Trump administration is notorious for enacting more subtle, under-the-radar measures to deter migrants or slow them down, McKanders said.

'The judge, jury, and executioner'

In this Thursday, July 26, 2018 photo people line up to cross into the United States to begin the process of applying for asylum near the San Ysidro port of entry in Tijuana, Mexico. Associated Press/Gregory Bull

For instance, McKanders recalled witnessing migrants lining up at US ports of entry last December and taking numbers, after Border Patrol agents told them there wasn't enough space to process them all. McKanders said she met a woman who was told to wait two months before they'd let her enter.

The practice is called "metering," but unlike major policies such as "zero tolerance," metering was done much more subtly — at select ports of entry rather than all of them, and it was never formally rolled out.

"I've been practicing [immigration law] since about 2006, and I was really surprised to see the informal policies that were in place," McKanders said. "There are informal systems that are at work and unwritten policies that are also having a significant impact on immigration."

Matthew Kolken, an immigration lawyer in Buffalo, New York, told INSIDER he often works with clients who experience even more underhanded attempts by the Trump administration to deprive migrants of their rights. He said some of their immigration trials have been done via televideo conferencing, while some have been overseen by immigration judges who have just an hour and a half to hear their cases.

Hundreds of people overflow onto the sidewalk in a line snaking around the block outside a U.S. immigration office with numerous courtrooms Thursday, Jan. 31, 2019, in San Francisco. Associated Press/Eric Risberg

Kolken said he expected that "things will absolutely change" under new leadership at DHS.

"My concern is that we are about to see a further erosion of due process protections, and that CBP will be empowered to be the judge, jury, and executioner," he said.

It's not an impossible scenario — Trump reportedly told Border Patrol agents last week to block migrants from entering, despite what federal judges say.

"If judges give you trouble, say, 'Sorry, judge, I can't do it. We don't have the room,'" Trump said, according to two anonymous sources who talked to CNN.

But not all immigration lawyers are pessimistic. Greg Siskind, an immigration lawyer in Memphis, Tennessee, said he expects that DHS staff would likely disobey such an order, out of fear of being held in contempt or facing personal liability.

"I'm guessing there will be internal resistance from the career employees who are not going to simply follow any order," he told INSIDER. "As for the courts, I think it is likely that judges are going to do their jobs and ensure that the law is followed."