Earlier today, the Supreme Court, by a narrowly divided vote, upheld the individual mandate, a key component of President Obama's signature piece of legislation, the Patient Protection and Affordable Care Act. Obama supporters are letting out a collective sigh of relief, as most observers expected the mandate -- and possibly the entire Act -- to fall after the oral argument. Conservatives are conversely upset that Chief Justice Roberts -- the deciding vote in the case -- snatched defeat for conservatives from the jaws of victory, given that there were four votes to strike down the Act in its entirety.

Although the decision is certainly a win for Obama and Democrats, it's by no means a clear-cut victory. And while the Chief Justice is taking a lot of heat from the right, the way he handled the case might actually turn out to be a brilliant strategic move -- one that could very well define his judicial career, and could actually be the optimal outcome for Republicans.

To explain -- and I promise this historical detour will be worth it -- we should note unexpected parallels to Marbury v. Madison, the 1803 case in which the Supreme Court, in an opinion by Chief Justice Marshall, established that it had the power of judicial review: i.e. to declare federal laws unconstitutional. The very simplified background is this: The petitioner, William Marbury, had been nominated as a justice of the peace by President John Adams at the very end of Adams's term, right before Thomas Jefferson took office. The Senate confirmed the nomination.

Unfortunately for Marbury, he never got his hands on his commission. Marbury's nominations had been part of a large slew of judicial nominations pursuant to the Judiciary Act of 1801 -- a statute passed by the Federalists after the 1800 election as a last minute attempt to stack the bench with Federalist judges before Jefferson and his party took office. Once Jefferson was sworn in, his secretary of state, James Madison, refused to deliver the undelivered commissions and the new Congress got to work repealing the Judiciary Act of 1801.

Marbury went to the Supreme Court, asking the Court to issue a writ of mandamus -- an order telling Madison he had to deliver the commission to Marbury. The Court was full of Federalists like Marshall, but Jefferson thought he had the justices boxed in. They could either rule that Marbury's rights hadn't been violated, vindicating Jefferson's supposition that the appointments did not need to be honored. Or they could issue a writ of mandamus ordering the secretary of state to deliver Marbury's commission. But Jefferson would likely have simply ignored it, in which case the Court's credibility would have been permanently damaged.

Chief Justice Marshall did something no one expected: writing for the Court, he ruled that Marbury's rights had been violated, thereby refusing to give a judicial imprimatur to Jefferson and Madison's actions. But his opinion did not issue a writ of mandamus that the Administration could simply ignore. Instead, it provided no remedy to Marbury, because of a technicality: The statute under which he had sought mandamus relief authorized such petitions to be filed directly in the Supreme Court. But Marshall concluded that that statute was unconstitutional, because in the Court's reading it could only authorize appellate jurisdiction over mandamus suits. In doing so, the Court built its own power and prestige by establishing that it had a power it was not necessarily assumed to have before: the authority the strike down federal statutes that violated the Constitution. But in doing so, the Court gave Jefferson absolutely nothing he could use politically: the opinion clearly rebuked his actions, but it didn't give him an order he could defy.

The parallels here are eerie. President Obama was ready for the Court to uphold the mandate -- in which case he would have trumpeted the decision as a vindication of the law and a rejection of Republican criticism that Democrats had overreached. And he similarly, was ready for the Court to strike down the mandate, or even the whole Act (apparently, he had three different speeches prepared for all the possibilities). He'll never read those speeches, but he almost certainly would have challenged the Court head-on and tried to make its conservative bent into a wedge issue in his campaign -- he has been quite willing to politicize the Court in the past. There was no prospect that Obama would have ignored the ruling -- as Jefferson might have ignored a mandamus writ -- but the ensuing political struggle could have damaged the Court's credibility. And it might very well have hurt Roberts's legacy in particular, given that there had been a focused attempt in the press to paint a narrative about him as the leader of a Court out to get Democrats and Obama.

So the president was ready for the Court to break right or break left. But instead, Chief Justice Roberts juked. He agreed with the challengers that the mandate couldn't be justified under the Commerce Clause or even the Necessary and Proper Clause -- thereby reinforcing the narrative that the Democratic Congress overreached in passing the bill. His opinion -- though not the result -- may provide much help in the future to judicial conservatives, as it suggests that, with the dissent, five justices are in favor of a more aggressive role for the Court in policing the bounds of the Commerce Clause (and the Spending Clause, which was at issue in the Medicaid legislation). And while Roberts ultimately voted to uphold the Act, he did so on a ground that, for Obama, plays terribly: that it's a tax.

Now, much as Jefferson was two centuries ago, Obama is boxed in. What is he to do? He can't criticize the Court for judicial activism, as it upheld the law (putting aside the way the Court limited the Medicaid provisions, which are not particularly salient to voters). The decision undercuts a potential theme of his campaign -- that a conservative Court is out of control. And yet Obama can't trumpet the decision either, since it states that Democrats overreached in trying to justify the law under the Commerce Clause. Worse yet, it calls the mandate something that Democrats didn't want it to be: a tax.

Conversely, the decision may be the optimal result for Mitt Romney. If the Court had struck down the mandate, it would have taken off the table an issue that Republican base voters care tremendously about. But in upholding the law, the Court didn't just leave that issue on the table; it gave Romney tremendous ammunition he can use to criticize Obama as a tax raiser.

There was much contrarian wisdom floating around prior to the decision about how a defeat might be helpful to Obama, as he could run against the Court. Jeffrey Toobin criticized this as "nonsense": "Winners win, and losers lose." We'll never know if Obama could have potentially won by losing the health care case. But the coming months will tell whether he might have lost by winning.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.

Daniel Epps is an associate at King & Spalding LLP in Washington, D.C. and a former law clerk to Justice Kennedy.