Washington (CNN) The Supreme Court grappled on Wednesday with the scope of an immigration law that allows the government to detain without bond those living in the US legally with past criminal records.

The case centers on whether detention must occur promptly upon an immigrant's release from criminal custody or whether it can happen months or even years later when the individual has resettled into society. The statute says simply that the arrest can occur "when" the person is released from custody.

The arguments come as the government has taken a hard line across the board on enforcing immigration laws.

Justices were reviewing an opinion from a panel of judges on the 9th US Circuit Court of Appeals, which ruled against the government in 2016 holding that the Department of Homeland Security can detain without bond only those criminal aliens who were taken into immigration custody "promptly upon their release from the triggering criminal custody," not those detained long after.

Other courts have split on the issue.

Read More