President Obama always knew his plan to shield millions of immigrants from deportation would enrage Republicans on Capitol Hill who oppose most of what he does.
But by claiming the power to forge ahead based on his executive authority, the president may well lose the one conservative he still really needs: Chief Justice John G. Roberts Jr.
Two years ago, the chief justice surprised many by joining liberals on the court to uphold the constitutionality of Obama's Affordable Care Act. And he probably holds the deciding vote in a second legal challenge to the healthcare law — one that seeks to eliminate government insurance subsidies to low- and middle-income enrollees in two-thirds of the nation.
But Roberts, an appointee of President George W. Bush, has shown an increasing skepticism toward what conservatives call Obama's tendency to overreach.
In June, the high court ruled Obama exceeded his power when he made temporary recess appointments during a brief Senate break. Roberts joined Justice Antonin Scalia in a separate opinion that would have gone further by banning nearly all such appointments. They asserted "all presidents have a high interest in expanding the powers of their office" and it was the court's duty to keep them in check.
The same week, a 5-4 majority that included the chief justice ruled that the administration went too far when it required Christian business owners to pay for certain contraceptives for female employees.
When Obama announced his executive action on immigration last month, it set off another furor on the political right, where it was denounced as an abuse of power befitting a "monarch" or an "emperor."
Ilya Shapiro, a lawyer for the libertarian Cato Institute, said the immigration order is the "starkest example" of what he called the president's "pattern of lawlessness."
The question now is whether the president's immigration action will influence the thinking of the justices, and particularly of Roberts, as they consider in the upcoming healthcare case whether the president exceeded his authority.
At issue is whether the administration must abide by one provision in the healthcare law, which says subsidies may be paid to those who enrolled in state health exchanges, or whether the president can extend those benefits to include people who signed up on the federally run exchange.
The administration argues the healthcare law, read as whole, shows Congress intended to make the subsidies available nationwide. But critics are appealing to Roberts and the court's conservatives, arguing the president and his advisors have no power to unilaterally change a law passed by Congress.
Their argument echoes the criticism voiced over Obama's immigration directive, accusing the president of trying to fix a broken system by acting on his own rather than waiting for Congress.
Experts say that legally the healthcare case is a close call. If so, the outcome may turn on whether the justices are inclined to give the president the benefit of the doubt, or whether they believe it's time to rein him in.
Obama's bold decision to press ahead with his immigration order in the wake of the GOP victories in the midterm election will not escape the attention of the court's conservatives.
Shapiro said the new immigration plan will "confirm the chief justice's view" that the court should not allow the administration to revise laws passed by Congress.
Many presidents have been stung when the Supreme Court turned against them for overstepping their powers.
After the Sept. 11 attacks, Bush enjoyed broad support for his "war on terrorism." But when Bush brandished his power as commander in chief and insisted he alone set the rules for detained terrorists, the high court turned against him.
Bush suffered three defeats over his efforts to hold detainees without a hearing at the Guantanamo Bay prison facility in Cuba. "A state of war is not a blank check for the president," said Justice Sandra Day O'Connor, a Republican appointee who faulted Bush's go-it-alone approach.
President Clinton had long been beset by rumors over his personal life when the Supreme Court cleared the way for lawyers for Paula Jones to question him under oath in her sexual harassment lawsuit. The decision helped trigger impeachment proceedings against Clinton.
President Truman was in deep political trouble when the high court rebuked him for using the military to seize steel mills during the Korean War. And President Nixon resigned in 1974 shortly after the court ruled he must turn over the Watergate tapes.
Obama's presidency is not at stake before the high court, but a defeat in the healthcare law dispute of King vs. Burwell could cripple the program.
Justices Antonin Scalia, Anthony M. Kennedy, Clarence Thomas and Samuel A. Alito voted to strike down the law entirely in 2012. When the case comes up for argument in March, Obama's lawyers will be hoping the chief justice is not ready to join them this time.