WASHINGTON (Reuters) - Supreme Court justices on Tuesday expressed skepticism about the Obama administration’s argument that the U.S. Congress can keep sex offenders in custody for an indefinite time beyond their prison sentences.

Solicitor General Elena Kagan, the administration’s top courtroom lawyer, urged the justices to uphold a 2006 federal law providing for the continued detention of sexually dangerous federal inmates who have completed their prison terms.

Chief Justice John Roberts asked Kagan why the federal government’s authority in such cases does not end when the prisoner’s sentence is done.

The Supreme Court in 1997 ruled that U.S. states could confine dangerous sex offenders to mental institutions after they serve their sentences. The issue on Tuesday was whether the federal government also had that authority.

Politicians from both U.S. political parties have backed tougher measures to deal with sex offenders in the U.S. criminal justice system to try to make sure they do not commit repeat crimes.

Crime has been a major issue in U.S. politics and many elected officials are sensitive to any accusations from opponents that they are too lenient on violent convicts. There has been ongoing public concern over repeat sexual offenders.

‘TAKING OVER EVERYTHING’

Of the nine Supreme Court members, conservative Justice Antonin Scalia appeared the most troubled by the law.

Scalia told Kagan he was unimpressed by her argument that the federal government had to step in because some states might not confine prisoners who pose a danger. “This is a recipe for the federal government taking over everything,” Scalia said.

Justice Sonia Sotomayor said that under the government’s theory, any dangerous person could be held indefinitely.

A U.S. appeals court struck down the law for exceeding the limits of congressional authority and for intruding on police powers the U.S. Constitution reserves for the states, many of which have their own similar laws.

The law had been challenged by five inmates who had been kept in custody at a federal prison hospital in North Carolina after their sentences ended.

The federal law defined “sexually dangerous” as someone who suffered from a serious mental illness, abnormality or disorder and would have difficulty in refraining from sexually violent conduct or child molestation if released.

Kagan defended the law. Of approximately 15,000 federal prisoners who have engaged in sexually violent acts or child molestation, the government has identified only about 100 inmates for detention after serving their sentence, she said.

Kagan ended her argument by saying that Congress took the reasonable step of making sure the federal government can continue to hold a sexually dangerous, mentally ill prisoner when the state would not act.

G. Alan DuBois, an assistant federal public defender in North Carolina, argued that the law should be struck down and said the government’s power to hold someone ended once the prison sentence has been served.

A decision in the case is expected by the end of June.