After battling Republicans in Congress for more than six years, President Obama and his lawyers will spend much of his remaining time in office fighting in the courts to preserve the administration's most significant domestic achievements.
The fate of Obama's healthcare law again rests with the Supreme Court, in a case that will decide this month whether the administration may continue to subsidize health insurance premiums for millions of low- and middle-income Americans.
Likewise Obama's effort to defer deportation and extend work permits to as many 5 million immigrants in the U.S. illegally is stalled in a Texas federal court. And legal battles are just getting underway in Washington over his plan to fight climate change by forcing a 30% reduction in carbon pollution.
Though all presidents have their share of legal battles, particularly at the end of their terms, Obama's accomplishments in office will turn to unusual degree on how he fares before the high court, legal experts say.
"Not since the New Deal has the court been as involved in defining a president's legacy," said Irving L. Gornstein, a Georgetown University law professor who directs its Supreme Court Institute. "Healthcare is Obama's defining achievement. It's the one thing that everyone associates with him. If healthcare goes down, the Obama legacy will be seriously compromised."
White House aides say they are confident the president's initiatives will survive legal challenges, noting that the Supreme Court upheld the Affordable Care Act as constitutional in 2012 by a 5-4 vote and that other federal judges allowed his previous immigration reform plan, Deferred Action for Childhood Arrivals, to take effect.
They also argue that the policies now facing court challenges represent only a fraction of president's legacy, including the economic recovery from the Great Recession, restoring diplomatic ties with Cuba and implementing Wall Street reforms.
Obama is not alone in having to defend his record in court.
President George W. Bush faced his own Supreme Court battles and suffered three successive defeats over his handling of the prison at Guantanamo Bay, Cuba. Bush insisted that as commander in chief, he alone could set the rules for detaining foreign prisoners. The justices disagreed, ruling that the Constitution's protection of the right to "habeas corpus" gave prisoners held by U.S. authorities the right to appeal in court.
Among the most famous clashes between the high court and a president came during President Franklin D. Roosevelt's first term. The justices struck down a series of his New Deal measures, but after FDR's landslide reelection in the fall of 1936, the justices reversed course. They upheld minimum wages and the Social Security Act, and new Roosevelt appointees to the court ensured his legacy would survive in law.
For Obama, the most important ruling will come in King vs. Burwell by the end of June. If the justices decide that federal subsidies are illegal in states that did not create their own insurance "exchanges" under the healthcare law, more than 6 million people could lose their coverage, unraveling the program in two-thirds of the states.
The case turns on a four-word clause that had gone unnoted in 2010 when Congress, then under Democratic control, passed the law. While it promised subsidies to help people buy insurance, one provision said these payments would go for coverage bought through an exchange "established by the state."
However, 34 states, many with Republican-controlled state governments, decided against establishing an exchange and opted instead to rely on the federal exchange. The justices could decide that the law, when read as a whole, shows that all qualified buyers may obtain subsidies. However, they could read the four-word clause to mean subsidies are limited to policyholders in only 16 states.
A ruling along the lines of the latter -- possible from the five Republican appointees to the court -- could blow up in the face of GOP leaders in Congress and in state capitals. In states such Texas, Florida, Ohio, Pennsylvania and North Carolina, several hundred thousand residents who recently obtained insurance could be hit with a steep hike in their rates.
The White House is ready to blame the court and Republicans if the subsidies are struck down.
"If the Supreme Court were to throw the healthcare system in this country into utter chaos, there would be no easy solutions for solving that problem," White House Press Secretary Josh Earnest said Wednesday. "We've seen many Republicans be very willing to try to play politics in a rather cynical way on this issue, but not a lot of constructive engagement to solve problems."
House Majority Leader Kevin McCarthy (R-Bakersfield) said this month that Republicans are working to prepare for the decision.
"Don't expect us to predetermine the Supreme Court," he said when pressed by reporters last week to outline what the party's response might be. "What we have to first see [is] what their decision is and what we have to solve. But I feel comfortable with where we are right now, that we are prepared for whatever decision they make to be able to have an answer for a solution quickly."
In recent decades, the two parties have gone back and forth on the issues of executive power and the role of the courts. Predictably, the party that does not occupy the White House accuses the president of abusing power.
A decade ago, Democrats cheered court decisions that tried to rein in the National Security Agency or the Guantanamo prison. Republicans complained of "activist" judges who sought to "legislate from the bench."
Now it is Republicans who are turning to the courts and accusing the president of abusing his authority. Last year, the House under Republican control voted for the first time to sue a president for exceeding his authority.
Jonathan Turley, a George Washington University law professor who said he voted for Obama, signed on as the lead lawyer for the House. His suit says Obama chose to extend several deadlines set in the healthcare law and opted to spend money that was not appropriated by the House.
For Democrats, alleged conservative court activism has emerged as a key issue in the early stages of the 2016 presidential campaign. Hillary Rodham Clinton has turned a spotlight on decisions that limited voting rights and opened the door for more money in politics.
On Thursday, she called on Congress to reinstate provisions of the Voting Rights Act that the high court struck down in 2013. In May, she pledged to only consider Supreme Court nominees who would vote to overturn Citizens United, the 2010 ruling that said corporations and unions were free to spend unlimited sums to support political campaigns.
When the U.S. 5th Circuit Court of Appeals in New Orleans blocked the president's latest deportation-deferral program for immigrants from taking effect, Clinton was quick to stand with the White House.
"[Obama] followed precedent, took steps for families when GOP House wouldn't. Must continue the fight," she tweeted.