Now that the Supreme Court has upheld the individual mandate and Affordable Care Act, President Barack Obama faces the challenge of recasting public opinion on the issue. (Carolyn Kaster/AP)

Of all the instant responses on Twitter to Thursday’s momentous Supreme Court decision upholding the individual mandate and Affordable Care Act—the calls on who predicted right, the cracks made at CNN’s expense, the counts of the number of times “broccoli” appeared in the Court’s decision—my favorite were two that came from presidential historian Doris Kearns Goodwin. On the ruling, she recalled a quote from Lincoln in two tweets: “Public sentiment is everything. With public sentiment, nothing can fail; without it nothing can succeed,” followed by “consequently, he who moulds public sentiment goes deeper than he who enacts statutes or pronounces decisions.”

The Supreme Court may have just saved President Obama from one of the worst leadership dilemmas any president could face: How to recover when your signature achievement—the one that took untold amounts of political capital and remains unpopular with many—is struck down. But while Obama will not have to do that (you can imagine the champagne corks flying at the White House), the leadership task ahead of him is not an easy one either.

As Sarah Kliff writes on Wonkblog this morning, mentioning the 2012 elections, the states and of course public opinion, “many obstacles still stand in the law’s way, ones that could derail its success nearly as much as an adverse legal ruling.”

Obama’s challenge now is to hit the reset button on shaping public opinion of the law. It’s a tricky task: On the one hand, as we all know by now, the majority of Americans (even Republicans) support many of the provisions of the law, even if they dislike the individual mandate. As countless pundits have told us, what Obama messed up was the messaging.

Here’s Peter Ubel, a physician and professor of business and public policy at Duke University, writing last month at Psychology Today: “The Obama team made a mistake in not marketing the mandate as being an inevitable part of its efforts to stop insurers from either denying coverage to people with pre-existing conditions, or charging premiums that are beyond anybody’s reach.”

Changing public opinion on the law could be much harder to do now than if it had been done earlier on. Obama is hardly out of the woods: As the election nears, the Court’s decision is likely to prompt those who oppose the law to harden their views, energizing support for Romney, who intends to repeal the law if elected, and for other candidates or Congress members pledging its demise. The entire point of the individual mandate—that by getting everyone to buy insurance, it helps to lower costs to make some of the other provisions possible—could still be undermined. People could choose instead to pay the penalty, and as MIT health care economist Jonathan Gruber told Kliff, “there’s certainly a risk that a large opposition could mitigate the effects of the mandate.”

Still, the Supreme Court’s decision frees Obama up to do what he should have been doing, or at least doing better, all along: persuading people as to why these reforms matter. His statement Thursday following the ruling seemed to take the first step in bridging the gap in public opinion, acknowledging that he knows “the debate over this law has been divisive” and that it “should be pretty clear I didn’t [push for these reforms] because it was good politics.” And he left open the door to modifications, saying twice that he wants to work together to improve the law “where we can” or “where necessary.”

In the end, Kearns Goodwin is right. Successful leaders don’t just enact statutes. They mold public sentiment to ensure their success. The Obama administration scored a huge victory with Thursday’s ruling, but what may be its biggest fight is still to come.

More from On Leadership:

Obama gets back to leadership basics

Gov. McDonnell and U-Va.

View Photo Gallery: Highlights from the commencement addresses given by politicians, celebrities and other notables this year.

Like On Leadership? Follow us on Facebook and Twitter:

@post_lead | @jenamcgregor | @lily_cunningham