WASHINGTON (CN) – Backing expanded registration requirements for sex offenders, the Supreme Court found it constitutional Thursday for the law to cover anyone with a prior conviction.

When Congress overhauled the Sex Offender Registration and Notification Act, otherwise known as SORNA, in 2006, lawmakers set new baselines for state systems and expanded the number of crimes for which offenders must register. The law offered no guidelines, however, for the registration requirements that confront the half-a-million people in the United States with prior sex crime convictions.

SORNA states only that “the attorney general shall have the authority to specify” how the law applies to such offenders, and different state attorneys general have in turn issued different guidelines.

In New York, the law led prosecutors to accuse Herman Avery Gundy of failing to properly register as a sex offender before attempting interstate travel. Seven years earlier, Gundy had entered what is known as an Alford plea to sexual assault of a minor.

The Second Circuit ruled that Gundy was required to register under SORNA after his release from prison in 2012, and the Supreme Court affirmed Thursday morning in a 5-3 decision.

The majority opinion penned by Justice Elena Kagan says the role of state attorneys general in the context of SORNA does not violate the nondelegation doctrine, which says Congress cannot delegate its legislative power to an executive agency without giving an “intelligible principle” for the agency to fill out the policy.

“The attorney general’s role under §20913(d) was important but limited: It was to apply SORNA to pre-Act offenders as soon as he thought it feasible to do so,” Kagan wrote. “Congress had made clear in SORNA’s text that the new registration requirements would apply to pre-Act offenders. So ‘there was no need’ for Congress to worry about the ‘unrealistic possibility’ that ‘the attorney general would refuse to apply’ those requirements on some excessively broad view of his authority under §20913(d).”

She added, “Indeed, if SORNA’s delegation is unconstitutional, then most of Government is unconstitutional—dependent as Congress is on the need to give discretion to executive officials to implement its programs.”

The majority opinion states that the language in SORNA does not give attorney generals “unguided” or “unchecked” power, as Gundy suggested.

“The text, considered alongside its context, purpose, and history, makes clear that the attorney general’s discretion extends only to considering and addressing feasibility issues,” the ruling states. “Given that statutory meaning, Gundy’s constitu­tional claim must fail. Section 20913(d)’s delegation falls well within permissible bounds.”

Kagan was joined in her opinion by Justices Ruth Bader Ginsburg, Stephen Breyer and Sonia Sotomayor. Justice Samuel Alito wrote a separate opinion concurring in the judgment.

Justice Brett Kavanaugh took no part in the decision because he hadn’t been confirmed yet when the court heard oral arguments last October.

Justice Neil Gorsuch dissented, and was joined by Chief Justice John Roberts and Justice Clarence Thomas.

Gorsuch wrote that the majority endorses an “extraconstitutional arrangement but resolves nothing.”

“The Constitution promises that only the people’s elected representatives may adopt new federal laws restricting liberty. Yet the statute before us scrambles that design. It purports to endow the nation’s chief prosecutor with the power to write his own criminal code governing the lives of a half-million citizens,” he said. “Yes, those affected are some of the least popular among us. But if a single executive branch official can write laws restricting the liberty of this group of persons, what does that mean for the next?”

Mark Chenoweth, executive director and general counsel of the New Civil Liberties Alliance, agreed with Gorsuch in a statement Thursday.

“NCLA agrees with the Gundy v. U.S. dissenters that allowing ‘the nation’s chief prosecutor the power to write his own criminal code’ is ‘delegation running riot’—even for this single statute. However, we take solace in the apparent willingness of four justices to reconsider the nondelegation doctrine in short order, and NCLA will be on the lookout for an appropriate case to bring to the Court’s attention for that purpose,” Chenoweth said, referring to Justice Alito’s separate concurrence.