RICHMOND - A federal judge in Virginia ruled Monday that it is unconstitutional for the government to compel Americans to buy health insurance, marking the first time a court has struck down any facet of the massive new law to overhaul the nation's health-care system.

Although the opinion by U.S. District Judge Henry E. Hudson gives significant political ammunition to the law's opponents, it does not invalidate the entire law or force federal and state officials to stop the work of putting it into effect - steps Virginia had asked him to take.

The ruling by Hudson, named to the bench by George W. Bush, sets up a conflict with opinions by two Democratic-appointed judges who have concluded recently that the law is constitutional. The cases are among two dozen in federal courts across the country that challenge many aspects of the law. The final word is widely expected to come from the U.S. Supreme Court.

In his 42-page opinion, Hudson concluded that requiring most people to get insurance or pay a fine - as the law mandates starting in 2014 - is an unprecedented expansion of federal power and cannot be justified under Congress's authority to regulate interstate commerce.

The ruling elated Virginia's Republican governor and Attorney General Ken Cuccinelli II (R), who brought the case, and GOP leaders on Capitol Hill, who are vowing to try to take apart all or pieces of the law. "I am gratified we prevailed," Cuccinelli said in a statement. "This won't be the final round . . . but today is a critical milestone in the protection of the Constitution."

But the opinion is a partial win and a partial loss for the law's foes and supporters alike, according to legal and health-policy specialists. Its immediate practical effects - on patients, the health-care industry or regulators writing the fine print of how the statute will be carried out - will probably be slight, specialists say.

"It's important to distinguish between the theater and the politics, and the implementation [of the law], which is still being carried out," said Drew E. Altman, president of the Kaiser Family Foundation, a health-care research and policy organization.

White House officials played down the ruling's impact. They hinted that they will appeal to the 4th U.S. Circuit Court of Appeals but did not indicate how quickly they might act. Meanwhile, Virginia Gov. Robert F. McDonnell has begun trying to enlist fellow governors to press the Justice Department to skip over the customary step of bringing the case before federal circuit judges - and take it directly to the nation's highest court.

The lawsuit challenged the 2,000-page legislation that Congress adopted in March at the urging of President Obama, setting in motion the broadest changes to the U.S. health-care system in 41/2 decades. The legislation is designed to widen access to private and public health insurance and, to some degree, slow medical spending. Heralded by Democrats as a signature advance in domestic policy, the law continues to be disputed by Republicans, who will gain power in the new Congress in January, and GOP-led statehouses, as well as in the courts.

Hudson's ruling largely traced the reasoning he had followed when he issued an opinion over the summer, declining to dismiss the case at an earlier stage.

In the Virginia case, as in others across the country, the constitutionality of the individual insurance mandate, as the provision is known, hinged primarily on an interpretation of the clause in the U.S. Constitution that relates to the government's powers to regulate commerce.

Virginia argued that people who choose not to carry health insurance are not engaging in any type of commerce. For that reason, the commonwealth contended, Congress exceeded its powers by enacting a law that requires most Americans to buy coverage.