Arizona, the state at the forefront of efforts to crack down on illegal immigration, may revoke the business licenses of companies that knowingly employ undocumented workers, the Supreme Court ruled Thursday.

In a 5 to 3 vote, the court rejected arguments that control over illegal immigration is solely a federal responsibility and endorsed narrowly drawn state efforts to regulate the employment of those in the country illegally. Eight other states — Colorado, Mississippi, Missouri, Pennsylvania, South Carolina, Tennessee, Virginia and West Virginia — have passed similar laws that would punish companies for hiring undocumented workers.

Arizona’s provisions “fall squarely” into an exception in the federal immigration law that Congress wrote in 1986, Chief Justice John G. Roberts Jr. said.

Thursday’s decision does not not necessarily shed light on how the justices would view a more controversial Arizona law, S.B. 1070. The law contains, among other things, a provision requiring local law enforcement officials to check the immigration status of people they stop who they suspect have entered the country illegally. It has been challenged by the Obama administration and blocked by lower federal courts. The state has said it will ask the Supreme Court this summer to review the law.

Other aspects of the politically divisive immigration issue await the court as well. It has not decided whether to hear a challenge to a California law that grants in-state tuition rates to some illegal immigrants or if it will consider efforts of Hazleton, Pa., to revive local laws seeking to deny employment and housing to undocumented immigrants.

The law at issue in Thursday’s decision is the Legal Arizona Workers Act, which calls for revocation of a company’s business license if it has twice been found to knowingly or intentionally employ illegal workers.

The law requires companies to use a federal online program known as E-Verify — which challengers said was unreliable — to determine whether an employee is authorized to work.

The law was passed in 2007 and signed by Gov. Janet Napolitano (D), now President Obama’s secretary of homeland security.

It was opposed by an unusual coalition: the U.S. Chamber of Commerce, civil rights groups, labor unions and the Obama administration. Business groups criticize the patchwork of state and local efforts regulating employers, while civil-liberties groups worry about discrimination and racial profiling.

The 1986 federal Immigration Reform and Control Act preempts “any state or local law imposing civil or criminal sanctions” on employers who hire unauthorized immigrants. But Arizona took advantage of a parenthetical clause in the statute — “other than through licensing and similar laws” — to impose its own penalties.

A majority of the court agreed with the state’s reading of the federal law.

“It makes little sense to preserve state authority to impose sanctions through licensing, but not allow states to revoke licenses when appropriate as one of those sanctions,” Roberts wrote in the opinion.

Justices Antonin Scalia, Anthony M. Kennedy, Clarence Thomas and Samuel A. Alito Jr. agreed with the outcome.

Justices Ruth Bader Ginsburg, Stephen G. Breyer and Sonia Sotomayor dissented. Justice Elena Kagan did not take part in the case because she had worked on it while serving as Obama’s solicitor general.

Breyer, joined by Ginsburg, said the purpose of Congress’s 1986 law was uniformity, not encouraging individual state sanctions. Sotomayor agreed, in a separate dissent: “I cannot believe that Congress intended for the 50 states and countless localities to implement their own distinct enforcement and adjudication procedures.”

Roberts wrote that Arizona’s law was mindful of the federal law and dismissed the idea that employers would be so worried about losing their licenses that they would discriminate broadly against workers.

“The most rational path for employers is to obey the law — both the law barring the employment of unauthorized aliens and the law prohibiting discrimination — and there is no reason to suppose that Arizona employers will choose not to do so,” he said.

Jay Sekulow, chief counsel of the conservative American Center for Law and Justice, said the court’s decision “provides a realistic road map for states to take appropriate action in enacting legislation that is constitutional.”

On the other hand, the American Civil Liberties Union and the Chamber of Commerce stressed the narrowness of the ruling.

“The decision does not give states or local governments a blank check to pass any and every immigration law,” said Robin Conrad, executive vice president of the National Chamber Litigation Center.

“State and local laws that do not carefully and assiduously track federal law, or that merely masquerade as ‘licensing’ laws, would still be preempted.”

The case is Chamber of Commerce v. Whiting.