A federal appeals court has ruled that President Barack Obama violated the Constitution when he bypassed the Senate to fill vacancies on a labor relations panel.

WASHINGTON — In an embarrassing setback for President Barack Obama, a federal appeals court ruled Friday that he violated the Constitution in making recess appointments last year, a decision that would severely curtail the president's ability to bypass the Senate to fill administration vacancies.

The three-judge panel of the U.S. Court of Appeals for the D.C. Circuit said Obama did not have the power to make three recess appointments to the National Labor Relations Board because the Senate was officially in session — and not in recess — at the time. If the decision stands, it could invalidate hundreds of board decisions made over the past year.

The court said the president could only fill vacancies with the recess appointment procedure if the openings arise when the Senate is in an official recess, which it defined as the once-a-year break between sessions of Congress.

The White House had no immediate comment but is expected to appeal the decision. The same issue is currently before several other federal appeals courts.

The ruling also threw into question Obama's recess appointment of Richard Cordray to head the Consumer Financial Protection Bureau. Cordray's appointment, also made on Jan. 4, 2012, has been challenged in a separate case.

The court's decision is a victory for Republicans and business groups that have been attacking the labor board for issuing a series of decisions and rules that make it easier for the nation's labor unions to organize new members.

"With this ruling, the D.C. Circuit has soundly rejected the Obama administration's flimsy interpretation of the law, and (it) will go a long way toward restoring the constitutional separation of powers," said Sen. Orrin Hatch, R-Utah.

GOP House Speaker John Boehner welcomed the ruling as "a victory for accountability in government."

Obama made the recess appointments after Senate Republicans blocked his choices for an agency they contended was biased in favor of unions. Obama claims he acted properly because the Senate was away for the holidays on a 20-day recess. The Constitution allows for such appointments without Senate approval when Congress is in recess.

But during that time, GOP lawmakers argued, the Senate technically had stayed in session because it was gaveled in and out every few days for so-called pro forma sessions.

GOP lawmakers used the tactic — as Democrats had done in the past — specifically to prevent the president from using his recess power to install members to the labor board and the consumer board. They had also vigorously opposed the nomination of Cordray. The White House argued that the pro forma sessions — some lasting less than a minute — were a sham.

The three-judge panel, all appointed by Republican presidents, ruled that during one of those pro forma sessions on Jan. 3, the Senate officially convened its second session of the 112th Congress, as required by the Constitution.

"Either the Senate is in session or it is in recess," Chief Judge David Sentelle wrote in the 46-page ruling. "If it has broken for three days within an ongoing session, it is not in 'the Recess' described in the Constitution."

Simply taking a break of an evening or a weekend during a regular working session cannot count, he said. Sentelle said that otherwise "the president could make appointments any time the Senate so much as broke for lunch."

The judge flatly rejected arguments from the Justice Department's Office of Legal Counsel, which claimed the president has discretion to decide that the Senate is unavailable to perform its advice and consent function.

"Allowing the president to define the scope of his own appointment power would eviscerate the Constitution's separation of powers," Sentelle wrote.