On Wednesday, Justice Brett Kavanaugh will hear oral arguments in his first major case, Nielsen v. Preap, which seeks to resolve the question of whether the government can detain immigrants with past criminal records throughout the duration of their deportation proceedings and without a hearing.

The federal government has interpreted two 1996 laws, the Anti-Terrorism and Effective Death Penalty Act and the Illegal Immigration Reform and Immigrant Responsibility Act, to mean that in cases where an undocumented immigrant has been convicted of a crime, that person can be subject to mandatory incarceration for the duration of their deportation case without a hearing to determine their risk of reoffending.

The standard applies even to decades-old misdemeanors like marijuana possession or traffic offenses, and has resulted in a massive increase in immigrant detention, from a daily average of 7,474 in 1996 to a daily average of 39,322 in 2017.

The Ninth Circuit Court of Appeals found the government’s interpretation unconstitutional on due process grounds in 2016; other circuit courts, however, have supported the Department of Homeland Security’s argument that hearings will lead to a “gap in custody” that will let deportable immigrants slip through the cracks.

The ACLU, pointing to client Astrid Morataya, a legal permanent resident who was detained for more than two years without a hearing because of a 15-year-old low-level drug conviction, is arguing that the government’s interpretation results in “gross violations of due process for thousands of immigrants,” according to ACLU media strategist Inga Sarda-Sorensen, who called the current system “arbitrary.”

“The mandatory detention law was a draconian response to an imaginary problem,” said ACLU senior staff attorney Michael Tan in a statement. “There is no evidence that mandatory detention is needed to protect public safety. Instead of keeping dangerous criminals off the street, the law overwhelmingly has jailed people with minor and nonviolent offenses.”

In an amicus brief filed by Republican members of Congress, supporters of the Department of Homeland Security’s case argued that the Trump administration “must continue to be afforded broad power to detain, pending completion of removal proceedings, those aliens who have been convicted of serious crimes.”

“Experience has demonstrated that if those aliens are not detained,” the brief argued, “a large percentage of them will abscond, and a significant majority will commit new crimes before they can be apprehended and their removal proceedings completed.”

Nielsen v. Preap combines the cases of two immigrants, both legal U.S. residents, who were detained without hearings years after their conviction for low-level drug charges. The named defendant, Mony Preap, is a Cambodian-born refugee who has been a legal resident of the United States since 1981. Preap was convicted of marijuana possession in 2006, but after being charged with a non-deportable offense in 2013, was detained for months without a hearing.

Another co-defendant, Bassam Yusuf Khoury, a legal resident since 1976, was convicted of a minor drug violation in 2011, resulting in a 30-day sentence—and, two years later, a six-month detention without a hearing that nearly resulted in his deportation.

The case, originally filed in 2013, represents the first involving a hot-button issue of this Supreme Court term, and the first of Kavanaugh’s lifetime appointment on the Supreme Court. Kavanaugh’s participation in the oral arguments could be an early indication of his style of questioning—and whether his pre-confirmation promise of independence and impartiality will bear out.

The stakes are high for Trump, whose administration has made cracking down on undocumented immigrants a top priority, and who after securing the Republican presidential nomination pointed wary members of the party to the Supreme Court as reason enough to support his candidacy.

“If you really like Donald Trump, that’s great, but if you don’t, you have to vote for me anyway. You know why? Supreme Court judges, Supreme Court judges,” Trump once told a crowd at a campaign rally in Cedar Rapids, Iowa, in July 2016. “Have no choice, sorry, sorry, sorry. You have no choice.”

It was that campaign promise that helped keep Trump’s faith in Kavanaugh during the most blistering confirmation battle in modern Supreme Court history, when Kavanaugh’s seemingly simple path to replacing retiring Justice Anthony Kennedy on the nation’s highest court was derailed by multiple accusations of sexual assault dating back to his time as a student at a Maryland prep school. At the time, Trump stated that the numerous accusations of sexual misconduct against his nominee only strengthened his belief that Kavanaugh was innocent.

The allegations, which included sexual assault, exposing himself to women, and being present in gang rape, came to a head during the testimony of Dr. Christine Blasey Ford, a California professor who told the Senate Judiciary Committee that Kavanaugh sexually assaulted her at a gathering in high school.