The Supreme Court has often dealt a big blow to presidents in their second term.
Harry Truman was rebuked for claiming the power to seize strike-bound steel mills during the Korean War. Richard Nixon resigned shortly after the court ruled unanimously he must turn over the Watergate tapes.
Bill Clinton's impeachment was triggered by the court's decision that he must answer questions under oath in the Paula Jones sexual harassment case. And George W. Bush lost before the court when he claimed his power as commander in chief gave him almost unfettered authority over prisoners held at the Guantanamo Bay prison.
Now, as President Obama begins his last year in office, the court is set to render a verdict on his use of his executive authority. The justices will decide whether he violated the law by authorizing more than 4 million immigrants living in the U.S. illegally to come out of the shadows without fear of deportation and obtain work permits.
There are signs that at least some of the justices are ready to rein in the president's ability to take such bold action without the approval of Congress.
Never before has the high court ruled that a president violated his constitutional duty to "take care" that laws are "faithfully executed." Yet when justices agreed to hear the immigration case, they surprised many by asking both sides to present arguments on whether Obama's actions violated the rarely invoked "take care" provision. That question had not even been at issue when lower courts blocked Obama's plan from taking effect.
In a separate pending case this term, the court also will rule on whether the president and his healthcare advisors went too far by requiring Catholic charities and other faith-based employers to formally opt out of providing a full range of contraceptives to their female employees by citing their religious objections.
The faith-based entities argued that by notifying the government of their decision to opt out — which triggers a process under which employees would get contraceptive coverage by other means — they would be "complicit" in supplying "abortion-inducing drugs."
The decisions, both due by summer, will help answer a question that looms over Obama's presidency. Has he properly used his power as chief executive to circumvent congressional gridlock on issues such as immigration, climate change and healthcare, or has he gone too far and violated his duty to enforce the laws as set by Congress?
The cases come before the court with a backdrop of Republican claims that the president has overreached and abused his power. Former House Speaker John A. Boehner said Obama was "acting like a king" and "damaging the presidency" when he announced the deportation-relief plan now before the high court.
On the campaign trail, Sen. Ted Cruz of Texas promises GOP voters that, if he is elected president, his first task on his first day in the White House will be to "rescind every illegal and unconstitutional executive action of Barack Obama."
White House officials and supporters of the president counter that Obama's actions are not only legal and well within his discretionary authority, but that Congress has left him no choice by refusing to take action on pressing national problems.
Conservative scholars think Obama has left himself vulnerable by announcing broad executive actions on policies that had been considered and rejected by Congress, and which even he once said were beyond his authority.
In his first term, Obama told Latino activists who were pushing him to take unilateral action that he could not "waive away the laws Congress put in place" regarding the removal of immigrants who entered the country illegally. But later the president decided he did have the power to suspend deportation and offer "lawful presence" and work permits to as many as 5 million of those immigrants.
So far conservatives have mostly failed to derail Obama in the Supreme Court. Twice, the justices upheld the president's healthcare law against conservative attacks, with Chief Justice John G. Roberts Jr. casting his vote with the court's four liberals.
Four years ago, in a key test of state-versus-federal power, the court ruled for Obama after his administration sued to block Arizona from enforcing a law to crack down on immigrants in the country illegally.
In 2011, Obama and then-Atty. Gen. Eric H. Holder Jr. raised ruffles on the right when they announced the administration would not defend in court the Defense of Marriage Act, which recognized only marriages between a man and a woman. House Republicans took up the cause, but two years later the high court agreed with the administration and struck down key parts of the law as unconstitutional.
But the new immigration and contraceptive cases pose a tough test for Obama's lawyers. In last year's healthcare case, they were defending a law that had won approval in Congress, when both chambers were controlled by Democrats. "We must respect the role of the legislature and take care not to undo what it has done," Roberts said in upholding its system of insurance subsidies.
This year, by contrast, Obama is defending an executive action on immigration that was taken without the approval of Congress and in the face of fierce Republican criticism.
Similarly, the "contraceptive mandate" was not spelled out in the Affordable Care Act, as lawyers for Catholic bishops often point out. It was adopted later in a regulation issued by Obama's healthcare advisors.
But Obama's defenders, including immigration law experts, say the critics are missing the crucial point that the deportation laws give the chief executive a free hand to decide how or whether to deport those living here illegally. Contrary to what many assume, the law does not say federal officials must arrest and deport such people. Rather, it says they are "subject" to removal, based on policies and priorities set by the executive branch.
Obama's administration says it wants to focus on deporting criminals, security threats, gang members and drug traffickers, not parents and grandparents who have children in the United States legally.
The administration can quote a powerful voice to back up its view of the matter. "Aliens may be removed" if they entered the country illegally and committed crimes, said Justice Anthony M. Kennedy, but "a principal feature of the removal system is the broad discretion exercised by immigration officials.... Federal officials, as an initial matter, must decide whether it makes sense to pursue removal at all. As a general rule, it is not a crime for a removable alien to remain present in the United States."
Kennedy spoke for the court four years ago in rejecting Arizona's claim that immigrants who could not prove their citizenship should be arrested, and Roberts agreed. Kennedy's explanation of the deportation system may also defeat any claims that Obama is violating his duty to "faithfully execute" the law.
"The president is not claiming a constitutional authority to not enforce the law. He's claiming authority based on the immigration statute," said Walter Dellinger, a White House lawyer under President Clinton. "And if the court says he is wrong, then he will comply with that."
On Twitter: @DavidGSavage