WASHINGTON — The Trump administration expects to be sued over the draconian new immigration plan it unveiled Thursday afternoon, say two senior administration officials with knowledge of the discussions — but with Justice Brett Kavanaugh now on the Supreme Court, it expects to win.

In the weeks before the midterms, even those Trump administration officials who fought bitterly with each other over how to curtail illegal immigration learned they could agree on a few things.

First, of the measures most likely to be approved by the president, all were likely to lead to a lawsuit.

But second, when sued, they believed they would ultimately prevail. According to the two senior officials, they think that with Kavanaugh in place, the Supreme Court will rule in their favor.

Kavanaugh, who took the spot of the more moderate Justice Anthony Kennedy on Oct. 6, is known for his conservative opinions that often side with the executive branch's assertion of power.

Migrants, part of a caravan traveling en route to the United States, ride in a truck on the road that links Tapanatepec and Santo Domingo Ingenio, near Santo Domingo Zanatepec, Mexico, on Nov. 7, 2018. Carlos Garcia Rawlins / Reuters

President Donald Trump teased the plan in vague terms in a speech from the White House last week, vowing to block any immigrants caught crossing the border between designated ports of entry, even if they made a claim for asylum.

The administration published the rule Thursday, with a signed proclamation by the president by Friday morning. It is expected to place all future illegal border crossers — those arrested between ports of entry — into detention with expedited deportation, regardless of whether they make an asylum claim.

The ACLU has already announced plans to sue.

Previous executive actions on immigration, including the Trump administration's defense of the travel ban and its opposition to the Obama administration's Deferred Action for Childhood Arrivals program (DACA,) have landed in federal court. The travel ban was ultimately upheld by the Supreme Court and DACA is making its way there.

The hardline measures the White House is preparing to take to bar immigrants caught crossing the border illegally from claiming asylum are expected to follow the same path.

Although the Trump administration expects to be enjoined and stopped in the near term, they believe a policy based on the discretionary authority of the president over who is admitted to the U.S. will ultimately hold up in the Supreme Court, one of the officials said.

With Congress stalled on immigration reform, an executive action that is ultimately upheld in court is the best alternative, the other official said.

The Department of Homeland Security, which oversees U.S. Customs & Border Protection and Immigration and Customs Enforcement, declined to comment on its legal strategy.

The American Civil Liberties Union, which led lawsuits to stop the travel ban and to reunite families separated by Trump's "zero tolerance policy," is prepared to sue again.

"If the administration announces a ban on asylum for those who enter between ports of entry, we will be prepared to go to court as necessary," said Lee Gelernt, deputy director of the ACLU's Immigrants' Rights Project. "But we will wait to see precisely what is put into place."

Other legal experts and immigration advocates have said the policy would be in violation of domestic and international law. They cite international treaties that say an asylum seeker can make a legitimate claim anywhere, regardless of how they enter.