WASHINGTON — (TNS)  The Supreme Court on Thursday blocked President Joe Biden’s plan to require that most workers be vaccinated against COVID-19 or undergo weekly testing.

But the justices, in a separate decision, upheld a smaller and more targeted regulation that will require workers in hospitals and nursing facilities to be vaccinated. This rule, once put into effect, is expected to cover about 17 million people working in health care, the administration said.

In blocking the broader workplace rule, the court’s conservative majority agreed with Republican state attorneys who contended the president had overstepped his authority by requiring workers in companies and agencies with more than 100 employees to be vaccinated or tested regularly. There were exemptions for those who worked outdoors or at home, or had medical or religious objections.

The vote was 6-3. Biden’s rule was based on the Occupational Safety Health Act of 1970, which protects employees from toxins and other dangers in the workplace. The justices said it does not go so far as to authorize mandatory vaccinations.

In an unsigned opinion, the court’s conservatives said “it is telling that OSHA, in its half century of existence, has never before adopted a broad public health regulation of this kind — addressing a threat that is untethered, in any causal sense, from the workplace ... Although Congress has indisputably given OSHA the power to regulate occupational dangers, it has not given that agency the power to regulate public health more broadly. Requiring the vaccination of 84 million Americans, selected simply because they work for employers with more than 100 employees, certainly falls in the latter category.”

The three liberals dissented. They said the decision “stymies the federal government’s ability to counter the unparalleled threat that COVID–19 poses to our nation’s workers. Acting outside of its competence and without legal basis, the court displaces the judgments of the government officials given the responsibility to respond to workplace health emergencies.”

However, Chief Justice John G. Roberts Jr. and Justice Brett M. Kavanaugh joined with the court’s three liberals to uphold Biden’s testing requirement for hospitals and nursing homes. That requirement is based on the Medicare and Medicaid Acts, which authorize federal health officials to set standards to protect the health and safety of elderly and sick patients.

Justices Stephen G. Breyer, Sonia Sotomayor and Elena Kagan said they would have upheld both regulations.