In a major setback to Virginia Attorney General Ken Cuccinelli II, a federal appeals court on Thursday tossed out one of the most prominent challenges to the new federal health-care law.

Cuccinelli (R), the nation’s first attorney general to file a lawsuit challenging the 2010 law, immediately announced that he would appeal the decision to the U.S. Supreme Court.

A three-judge panel of the U.S. Court of Appeals for the 4th Circuit in Richmond found that Virginia lacked standing to sue. The panel’s unanimous decision, which did not address the merits of the case, overturns a lower-court ruling that the law’s mandate that practically all Americans obtain health insurance or pay a penalty is unconstitutional.

In a second but divided opinion, the panel also dismissed a separate suit filed by several individuals and Liberty University, a private Christian university in Lynchburg.

Cuccinelli has garnered significant national attention since being sworn in last year for suing a federal government that he argues often overreaches — on health care, global warming and the ability to regulate greenhouse gases. His actions have made him a tea party favorite who regularly appears on Fox News and, more recently, has been courted by Republican presidential candidates.

“Our disappointment not only stems from the fact that the court ruled against us but also that the court did not even reach the merits on the key question of Virginia’s lawsuit — whether Congress has a power never before recognized in American history: the power to force one citizen to purchase a good or service from another citizen,” he said.

Cuccinelli filed the lawsuit to much fanfare minutes after President Obama signed the health -care legislation into law on March 23, 2010.

“He made a hell of a mistake,’’ said state Senate Majority Leader Richard L. Saslaw (D-Fairfax), who opposed the lawsuit. “He thought he would make a huge impact. . . . It didn’t work out.”

Others had encouraged Cuccinelli to join 26 other states that are attempting to stop the health-care law, but he chose to go it alone, arguing that Virginia had a right to challenge the federal law because it conflicts with a state law making it illegal to require Virginians to purchase insurance.

Not so, said the 4th Circuit judges — all of whom were appointed by Democratic presidents, including two by Obama.

Mark Rozell, a political scientist at George Mason University, said that Cuccinelli will continue to have his critics who think his actions are based on ideology but that “the true believers” will see him as a hero for standing up to the system.

Mark Kevin Lloyd, chairman of the Virginia Federation of Tea Party Patriots, a statewide umbrella group, said the court decision just showed that Cuccinelli was correct when he speaks about activist judges.

“It’s just part of the fight,’’ Lloyd said. “Cuccinelli put the case together, and it went all the way to the 4th Circuit. He’s doing his job.”

In February, Cuccinelli and Gov. Robert F. McDonnell (R) asked that the U.S. Supreme Court immediately review the case, a rare legal request to bypass appeals and seek early intervention from the nation’s highest court. The court declined.

“Honestly, we were expecting that we’d probably lose given the panel of judges,’’ McDonnell said in an interview. “I’ve said for a year that the United States Supreme Court is going to make the final decision on that and maybe, ultimately, the United States Congress depending on what happens in the election.”

On behalf of the 4th Circuit panel, Judge Diana Gribbon Motz wrote that Supreme Court precedents only allow states to contest federal laws that hinder a state’s ability to regulate its citizens’ behavior or administer a state program. By contrast, “the only apparent function” of Virginia’s new law “is to declare Virginia’s opposition to a federal insurance mandate.”

As evidence, Motz cited not only the wording of the law itself but also the timing of the lawsuit — noting Cuccinelli’s filing on the day Obama signed the law.

Motz also quoted statements about the state law’s purpose made by McDonnell and Lt. Gov. Bill Bolling (R), concluding that if the court allowed Virginia to sue, “a state could acquire standing to challenge any federal law merely by enacting a statute — even an utterly unenforceable one — purporting to prohibit the application of the federal law.”

Legal analysts said the opinion underscored the risk Cuccinelli took by going it alone instead of joining the multi-state suit. That case was joined by several individuals, and judges have repeatedly found that because the insurance mandate would unquestionably apply to them, all plaintiffs in the case have “piggyback” standing.

“Virginia’s sovereign interest here was weak,” Cornell law professor Michael C. Dorf said. “It’s not clear to me why they didn’t at least enlist individual plaintiffs.”

From a legal, if not a political, standpoint, the panel’s majority opinion in the case brought by Liberty University was an even greater win for the Obama administration.

While the individual plaintiffs in that case dispute the insurance mandate, the university is challenging a related requirement that large employers offer their workers adequate health insurance or pay a penalty.

The two judges in the majority ruled that in both instances the penalty amounted to a tax. And since, under most circumstances, taxes cannot be contested in federal court in advance, none of the parties have standing to sue.

In his concurring opinion, Judge James A. Wynn Jr. went further, writing that even if the plaintiffs had not been precluded from challenging a tax, the fact that the mandate counts as one means it is constitutional.

This finding could resurrect the federal government’s oft-repeated but hitherto unsuccessful argument that Congress has the authority to impose the insurance mandate through its taxing powers. Until now, even judges siding with the government have rejected that logic, noting that the law’s drafters refused to call the penalty a tax. Instead, decisions upholding the law have been based in Congress’s right to regulate commerce.

Judge Andre M. Davis raised that objection in his dissent. But he wrote that although he thinks the plaintiffs do have the right to challenge the law, it represents a proper exercise of Congress’s commerce authority and should be upheld.

Still, Dorf said the panel’s decisions were of limited use to the administration because neither addresses the merits of the constitutional challenge head-on.

“Opponents of the law will probably benefit from the fact that they lost on standing grounds,” he said. “Otherwise, the court might have been inclined to side with the administration on the merits and that would have been a much bigger victory.”

In June, a divided panel of the Court of Appeals for the 6th Circuit in Cincinnati, ruling in a similar case, also sided with the government. And so far only one appeals panel has invalidated the insurance mandate — a split panel of the U.S. Court of Appeals for the 11th Circuit in Atlanta, ruling in the multi-state suit.

A fifth suit is scheduled for a hearing before the U.S. Court of Appeals for the District of Columbia Circuit this month.

The timeline still sets up a likely ruling in the spring, sometime before the Supreme Court’s term ends June 30.