WASHINGTON (AP) — The Supreme Court on Thursday limited the president's power to fill high-level vacancies with temporary appointments, ruling in favor of Senate Republicans in their partisan clash with President Barack Obama.

The high court's first case involving the Constitution's recess appointments clause ended in a unanimous decision holding that Obama's appointments to the National Labor Relations Board in 2012 without Senate confirmation were illegal. Obama invoked the Constitution's provision giving the president the power to make temporary appointments when the Senate is in recess.

Problem is, the court said, the Senate was not actually in a formal recess when Obama acted.

Obama had argued that the Senate was on an extended holiday break and that the brief sessions it held every three days — what lawmakers call "pro forma" — were a sham that was intended to prevent him from filling seats on the NLRB.

The justices rejected that argument Thursday.

Justice Stephen Breyer said in his majority opinion that a congressional break has to last at least 10 days to be considered a recess under the Constitution.

Neither house of Congress can take more than a three-day break without the consent of the other.

The issue of recess appointments receded in importance after the Senate's Democratic majority changed the rules to make it harder for Republicans to block confirmation of most Obama appointees.

But the ruling's impact may be keenly felt by the White House next year if Republicans capture control of the Senate in the November election. The potential importance of the ruling lies in the Senate's ability to block the confirmation of judges and the leaders of independent agencies like the NLRB. A federal law gives the president the power to appoint acting heads of Cabinet-level departments to keep the government running.

Republican leaders in both houses, House Speaker John Boehner and Sen. Mitch McConnell, praised the court for rejecting what they described as Obama's unconstitutional power grab. Senate Majority Leader Harry Reid said the decision underscores the importance of the Senate rule change to make sure that a small number of senators cannot block qualified nominees.

Story continues

Still, the outcome was the least significant loss possible for the administration. The justices, by a 5-4 vote, rejected a sweeping lower court ruling against the administration that would have made it virtually impossible for any future president to make recess appointments.

The lower court held that the only recess recognized by the Constitution is the once-a-year break between sessions of Congress. It also said that only vacancies that arise in that recess could be filled. So the high court has left open the possibility that a president, with a compliant Congress, could make recess appointments in the future.

Justice Antonin Scalia, writing for himself, Chief Justice John Roberts and Justices Samuel Alito and Clarence Thomas, said he would have upheld the lower court's reasoning. He said Thursday's decision means "the abolition of the Constitution's limits on the recess-appointment power."

Obama has made relatively few recess appointments, 32 in his five-plus years in office, according to the Congressional Research Service. President George W. Bush made 171 such appointments over two terms and President Bill Clinton filled 139 posts that way in his eight years in office, the research service said.

But Obama was the first president to try to make recess appointments when Congress explicitly said it was not in recess. The Constitution requires that the Senate and House must get the other's consent for a break lasting longer than three days. At the end of 2011, the Republican-controlled House would not give the Democratic-led Senate permission for a longer break.

The partisan roles were reversed during Bush's presidency, when Senate Democrats sought ways to prevent the president from making recess appointments.

In fact, the very basis on which the justices decided the case — that the Senate can use extremely brief sessions to avoid a formal recess — was a tactic devised by Reid to frustrate Bush.

On a practical level, there may be little difference between how the court decided the case and Scalia wishes it were decided, said Andy Pincus, a veteran Supreme Court lawyer in Washington.

"The practical effect of today's decision is to return the rules governing recess appointments to what just about everyone believed them to be before President Obama adopted a significantly broader view of that authority in January 2012. Those rules give Senate the ability to block all recess appointments by convening for pro forma sessions — a practice that began under the Bush administration and has continued in the Obama administration. The recess appointment power has receded into practical irrelevance as a result of this practice, and today's decision likely cements that reality," Pincus said.

A recess appointment can last no more than two years. Recess appointees who subsequently won Senate confirmation include Chief Justice Earl Warren and Justice William Brennan, Federal Reserve Chairman Alan Greenspan, two current NLRB members and Consumer Financial Protection Bureau director Richard Cordray. Former UN Ambassador John Bolton is among recess appointees who left office because they could not win a Senate vote.

The case challenging the appointments was brought by Noel Canning, a soft drink bottling company in Yakima, Washington. The company claimed an NLRB decision against it was not valid because the board members were not properly appointed and that the board did not have enough members to do business without the improperly appointed officials.

Noel Canning prevailed in the U.S. Circuit Court of Appeals for the District of Columbia, and two other appeals courts also had ruled against recess appointments.