President Barack Obama’s big gamble on recess appointments was smacked down unanimously by the Supreme Court on Thursday, an embarrassing setback for the administration just as Republicans are turning up the heat on alleged overreaches by the chief executive.

The justices all agreed that Obama took executive power too far by naming three nominees to a key labor panel during a three-day Senate recess in 2012.

GOP lawmakers are already seizing on the decision as more proof of claims they make in a lawsuit House Speaker John Boehner just announced plans to file: that this is a president gone rogue.

So while the White House braces for a new legal showdown with Congress over policies ranging from health care to immigration, they’re heading in with one loss already under their belt and Republicans feeling emboldened.

“It represents a clear — clear rebuke to the president’s brazen power grab,” Minority Leader Mitch McConnell said on the Senate floor. “It was a unanimous — unanimous — rebuke of the president of the United States. … The administration’s tendency to abide only by the laws it likes represents a disturbing and dangerous threat to the rule of law. That’s true whether we’re talking about recess appointments or Obamacare.”

Conservative legal experts said the ruling will bolster the Republican message.

“This will put wind in the sails of Boehner’s effort,” said the Pacific Legal Foundation’s Todd Gaziano. “The court didn’t say today, ‘Meet the new boss, same as the old boss.’ The court clearly said, ‘Meet the new boss, worse than the old boss.’ … No one has gone as far as this president since Nixon in trying to suspend laws he didn’t like.”

White House officials defended the recess appointments and many of Obama’s other actions as legitimate efforts to work around legislative gridlock caused by the Senate GOP.

“We’re of course deeply disappointed in today’s decision. … The president, though, remains committed to using every element of his executive authority to make progress on behalf of middle-class families,” White House Press Secretary Josh Earnest said. “The president is in no way considering scaling back his efforts to make progress for the American people. … We would much prefer to work in bipartisan fashion with Congress to get that done. But if Congress refuses to act, the president will not hesitate to act on his own.”

While the court’s liberals and Justice Anthony Kennedy cushioned the blow for the White House a bit by narrowing Thursday’s ruling, Republicans gleefully noted that every sitting justice had concluded that Obama’s appointments violated the Constitution.

“All the liberals on the Supreme Court agreed that the president was trying to overreach his power,” GOP consultant John Feehery said on MSNBC.

Complaints about overreach by Obama have been simmering for months, if not longer, but recent controversies have pushed that criticism to the fore.

A flood of child immigrants crossing into the U.S. from Mexico has drawn new attention to Obama’s decision to allow illegal immigrants who arrived as children years ago to stay in America in a quasi-legal status. The new arrivals aren’t eligible for that program, but some were sent based on rumors they might be.

Before swapping five Taliban prisoners at Guantánamo for Army Sgt. Bowe Bergdahl last month, the president failed to make the 30-day advance congressional notification the law requires.

And some liberals and conservatives remain aghast at the National Security Agency surveillance Obama authorized — efforts that echoed, and at times broadened, programs in effect under President George W. Bush.

It’s clear the president and his aides view his use of executive actions as a net political plus. They’ve even branded it as his “pen and phone” strategy — wielding a pen to issue executive orders and using his phone to urge outside groups to pressure Congress to act.

Senate Majority Leader Harry Reid (D-Nev.) issued a statement on the court ruling that didn’t offer a view on the decision, but praised the president for standing up to GOP gridlock.

“Since President Obama took office, Senate Republicans have done everything possible to deny qualified nominees from receiving a fair up-or-down vote. President Obama did the right thing when he made these appointments on behalf of American workers,” Reid said.

However, when it comes to recess appointments, the court’s majority opinion squarely rejects the justification the White House and the president have repeatedly offered: that the moves are an antidote to gridlock.

“The Recess Appointments Clause is not designed to overcome serious institutional friction,” Justice Stephen Breyer wrote. “Friction between the branches is an inevitable consequence of our constitutional structure. … That structure foresees resolution not only through judicial interpretation and compromise among the branches but also by the ballot box.”

One of the lawyers who advised Obama as he waded into the recess appointment fight, former White House Counsel Kathy Ruemmler, said she thought the Supreme Court ruling was far from a shutout for the president despite the unanimous rejection of his appointments.

“I actually was quite happy with the court’s decision today,” said Ruemmler, who left the White House last month. “It effectively ratified what presidents have been doing for 100 years. It said recess appointments made during recesses of more than 10 days essentially [are] presumptively valid. … That’s a big affirmation for presidential authority.”

Ruemmler told POLITICO the president’s decision to stand up to Republicans’ obstruction was the right one legally and politically. “It had a huge impact and a politically positive impact,” she said, noting that the move also installed a director for the Consumer Financial Protection Bureau and allowed that agency to begin issuing rules.

While some analysts have suggested that the recess appointment fight ultimately diminished presidential power, the former Obama legal adviser said that isn’t so. She noted that the practice of pro forma sessions began in 2007 and could not have been tested legally without the president defying it.

“All it does as a practical matter is restore things to the status quo ante,” Ruemmler said of the court’s ruling. “I don’t see how he or any other president is any worse off.”

Obama can’t say he wasn’t warned that his recess appointment gambit might not pay off. “The question is a novel one, and the substantial arguments on each side create some litigation risk for such appointments,” Justice Department lawyers warned in a legal opinion made public after the ruckus that accompanied the president’s 2012 move.

Some lawyers say they remain surprised Obama chose to make the appointments, knowing that lawsuits were certain.

“This was the weakest possible case the administration could have taken to the court,” said George Washington University law professor Jonathan Turley, a liberal who has testified in Congress against Obama’s assertions of executive authority. “It’s just shocking, this lack of adult supervision. … There was no evidence of intelligent design behind any of this litigation.”

Other legal experts see merits in some of the complaints about Obama’s use of executive authority but say they’re unlikely to be addressed through a lawsuit like the one Boehner plans to file.

“I think there’s a case to be made that Obama has exceeded the recent history of executive overreaching, but I don’t know that its remediable in court — or should be,” said former general counsel to the House of Representatives Stan Brand, a Democrat.

Brand said it’s undeniable and unremarkable that Obama was a steadfast opponent of executive overreach under President George W. Bush but seems to have a different perspective now. He noted that as a candidate, President Ronald Reagan favored giving Congress the authority to veto regulations, but as president he reversed course.

“To me, it’s all institutional, not personal,” Brand added. “It was fine for Obama to be against all these things — until he became president.”

Correction: This article has been updated to correct the name of the Pacific Legal Foundation.