At the U. S. Supreme Court Wednesday, the question before the justices boiled down to whether a sock can be considered drug paraphernalia.

Each year 30-35,000 people are deported for drug crimes. But federal law does not treat all drug crimes equally. The question before the justices was whether the government can deport legal permanent residents for minor drug offenses.

Moones Mellouli came to the U.S. on a student visa from Tunisia in 2004. He graduated with honors, then went on to earn two master's degrees — in applied mathematics and economics — from the University of Missouri-Columbia. He became a lawful permanent resident, worked as an actuary, and taught mathematics at the university.

But in 2010, he was arrested for driving under the influence and having four Adderall pills in his sock. Adderall is a drug prescribed to treat hyperactivity, but it's widely used by students and others to study and stay awake. Millouli pleaded guilty to a misdemeanor for possession of drug paraphernalia — namely the sock in which he had the four pills. He got a suspended sentence plus a year's probation, and he was subsequently deported.

He appealed his deportation all the way to the Supreme Court.

This is the fourth time in the last decade that the court has examined deportations for minor drug convictions, and in each of the previous cases, the court has ruled against the government.

On Wednesday, it looked very much as though the government's losing streak would continue, and Millouli would get the chance to return to the U.S.

The argument focused on the intersection between federal and state law as it applies to deportations for drug crimes. Federal law allows the government to deport a non-citizen convicted in state court for a crime "relating to" any drug controlled under the federal criminal code. But state laws often make many more drugs illegal, and Kansas law treats any container used to store a drug as "drug paraphernalia."

The government's argument that these paraphernalia convictions all justify deportation was greeted by the justices with unabashed incredulity.

"Because of the sock," the crime justifies deportation, asked a wide-eyed Justice Ruth Bader Ginsburg.

"Do you think a sock is more than tenuously related to these federal drugs?" piled on Justice Antonin Scalia.

If we look back to the charging documents, they "don't say anything about drugs," chimed in Justice Stephen Breyer.

"Paraphernalia offenses are generally extremely minor offenses — they're not felonies," noted Justice Elena Kagan. They're misdemeanors that prosecutors use "when they don't want to charge a more serious offense."

Assistant Solicitor General Rachel Kovner replied that just because prosecutors let someone plead to a lesser offense doesn't mean that immigration officials lack the authority to deport that individual when the crime is related to a federally controlled substance.

"I would have thought the opposite inference," countered Chief Justice John Roberts. "If it's not such a big deal that the state is willing to let him cop a plea to drug paraphernalia, why should that be the basis for deportation under federal law?"

Justice Samuel Alito returned to the sock: "It's really hard to believe that the Kansas statute actually regards as drug paraphernalia any thing that is used at any time to contain a controlled substance." So, you put the drug in a plastic bag — "that's one violation." Then the person puts the bag in a pocket — "that's another violation," and then in the glove compartment of the car — a third violation. "It can't really mean this."

Lawyer Kovner replied by asking: suppose the defendant had cocaine in his sock; under his theory, he would not have been deportable for having drug paraphernalia.

"If he'd had cocaine in his sock," Justice Kagan shot back, "he would probably be convicted of possession of cocaine."

But in this case, observed Kagan — the former dean of the Harvard Law School — "he had four pills of Adderall, which if you go to half the colleges in America ... and just randomly pick somebody," you'd find Adderall.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.