An immigration case before the Supreme Court pits the government against immigrants it wants to deport following crimes they have committed in the United States.

The issue in the case has to do with when federal law gives immigration authorities the ability to hold immigrants in custody and deny them a hearing to argue for their release while they try to avoid being deported. The case before the justices Wednesday involves mostly long-term green card holders who have been convicted of a broad range of crimes that make them eligible to be deported.

Immigration law says that noncitizens convicted of certain crimes should be detained when they are released from federal or state custody and then held while an immigration court decides whether or not they should be deported.

Get Breaking News Delivered to Your Inbox

But those affected by the law aren't always detained immediately and are sometimes not detained until years later. One of the lead plaintiffs in the case is Mony Preap, a lawful permanent resident of the United States since 1981. He has two convictions for possession of marijuana and was released from custody in 2006. But he wasn't taken into immigration custody until 2013.

Preap and others in his position, who are represented by the American Civil Liberties Union, argue that if they're not promptly detained after being released from custody and are instead picked up at some later date, their detention isn't mandatory. They say in that case they're entitled to a hearing to argue to an immigration judge that they aren't a danger to the community and are not likely to flee. If a judge agrees, they can then be released on bond. That's the same hearing rule that applies to other noncitizens the government is trying to deport.

The Trump administration argues, as the Obama administration did, against any hearing for former inmates affected by the law. The government says their detention is mandatory regardless of when they are picked up.

In Preap's case, which is a class-action lawsuit brought in California, and a similar class-action lawsuit brought in the state of Washington, courts found the government had to provide bond hearings. The San Francisco-based U.S. Court of Appeals for the 9th Circuit agreed. Other appeals courts have sided with the government in similar cases. Preap has since won his deportation case.

The case is 16-1363 Nielsen v. Preap.