DETROIT (AP) — A federal judge on Thursday upheld the authority of the federal government to require everyone to have health insurance, dealing a setback to groups seeking to block the new national health care plan.

The ruling came in a lawsuit filed in Michigan by a Christian legal group and four people who claimed lawmakers exceeded their power under the Constitution’s commerce clause, which authorizes Congress to regulate trade.

But Judge George Caram Steeh in Detroit said the mandate to get insurance by 2014 and the financial penalty for skipping coverage are legal. He said Congress was trying to lower the overall cost of insurance by requiring participation.

"Without the minimum coverage provision, there would be an incentive for some individuals to wait to purchase health insurance until they needed care, knowing that insurance would be available at all times," the judge said.

"As a result, the most costly individuals would be in the insurance system and the least costly would be outside it," Steeh said. "In turn, this would aggravate current problems with cost-shifting and lead to even higher premiums."

Julian Davis Mortenson, a University of Michigan law professor and former U.S. Supreme Court law clerk, said the decision affects only the parties in the lawsuit and is not binding on any other federal judges hearing challenges to the law.

Nonetheless, the Justice Department hailed Steeh’s opinion as the first time a "court has considered the merits of any challenge to this law."

"The court found that the minimum coverage provision of the statute was a reasonable means for Congress to take in reforming our health care system," spokeswoman Tracy Schmaler said. "The department will continue to vigorously defend this law in ongoing litigation."

Robert Muise of the Thomas More Law Center in Ann Arbor, Mich., which filed the case, said he would take it to a federal appeals court in Cincinnati.

The four individual plaintiffs said they do not have private insurance and object to being forced to buy it. They also fear that any financial penalty paid to the government would be used to pay for abortions.

In Florida, a federal judge is overseeing a lawsuit filed by 20 states. They, too, say the law is unconstitutional and claim it would force states to absorb higher Medicaid costs.

A decision on whether to dismiss the case is expected by Oct. 14, though the judge said last month that he would probably dismiss only parts of the complaint while letting others go to trial.

There is also a lawsuit pending in Virginia.

Randy Barnett, who teaches constitutional law at Georgetown University, said Steeh’s ruling could be cited by lawyers trying to persuade other judges.

"This is one judge’s opinion. They’ll read it," Barnett said. Steeh "accepted the government’s argument, the same argument that’s being made in front of other judges."