Late on Tuesday, March 27, halfway around the world, President Obama began one of the most suspenseful waits in recent presidential history.

After a blur of nuclear security meetings in South Korea, Mr. Obama settled into the Air Force One conference room to read a summary aides had written of that day’s arguments before the Supreme Court back in Washington. The justices had asked deeply skeptical questions about his health care law.

Mr. Obama’s most profound policy achievement was at much higher risk of defeat than his aides had expected, vulnerable to being erased by the margin of a single justice’s vote.

Since then, Mr. Obama and the White House have put on brave faces, insisting that the law and the mandate at its center will be upheld when the court rules this month. In private conversations, they predict that the bulk of the law will survive even if the mandate requiring Americans to buy health insurance does not.

But even if the White House is a fortress of message discipline, it cannot disguise the potential heartbreak for Mr. Obama, who managed to achieve a decades-old Democratic dream despite long odds and at steep cost.

If he loses both his law and re-election, many will conclude “that he bet on his major reform, and the Supreme Court defeated it, and he lost his hold on the presidency,” Robert Dallek, the presidential historian, said in an interview.

On the day the ruling comes out, one Obama adviser joked, “I might have to clean out my sock drawer.”

In grappling with what the court may do, Mr. Obama and his advisers now appear to be far past the denial stage (when they dismissed constitutional challenges) but nowhere near acceptance (they still believe the law will be upheld.) Instead, they have quietly entered a surprising new state that might be called Learning to Live Without Universal Coverage.

Former advisers are emphasizing the many aspects of the bill that are not connected to the mandate, like the subsidies to buy insurance. Some aides even argue privately that losing the mandate could be a political boon, because it would rob Republicans of their core complaint against the law.

But that position is uncomfortable for a deeper reason, one that goes to the core of who Mr. Obama wanted to be as president. Earlier in his term, he refused every chance to settle for the more limited health care overhaul that the Supreme Court may now effectively deliver, making epic sacrifices to win something far broader.

Before he became president, critics said that Mr. Obama’s greatest achievement was his own rise, that he played it safe — sometimes voting “present” in the Illinois State Senate — rather than taking risks for what he really believed. “What’s he ever done?” Representative Bobby L. Rush, Democrat of Illinois, asked repeatedly in 2000 when he crushed his upstart Congressional challenger, and opponents later echoed the question.

Early in the presidential race, Mr. Obama summoned the historian Doris Kearns Goodwin for a conversation about Abraham Lincoln. He was only an upstart candidate, but he was already talking about leaving a legacy, about accomplishing vast things.

In the White House, many of his top advisers, including Vice President Joseph R. Biden Jr. and his first chief of staff, Rahm Emanuel, counseled Mr. Obama against a sweeping health care overhaul. By summer 2009, with the country still stunned by economic crisis and Republicans falsely raising the specter of death panels, some aides practically begged the president to scale back, take interim steps and move on to other issues.

Mr. Obama did not relent. He had an economic rationale for stabilizing a dysfunctional health system, but he also “saw what Teddy called the moral issue,” Victoria Reggie Kennedy, Senator Edward M. Kennedy’s widow, said in an interview, referring to her husband. For those who wondered what Mr. Obama really believed in, universal health coverage seemed to be the answer.

As the brutal fight continued, the president sacrificed more and more in its name: an overhaul of energy and environmental laws, greater focus on economic issues, some of his own popularity and that of House Democrats, who eventually lost their hard-won majority. “Michelle and I are perfectly comfortable if we’re only here one term if we feel like we really accomplished something,” he told aides.

That declaration sounds different today. Mitt Romney, the presumptive Republican presidential nominee, uses “Obamacare” as an epithet and applause line, promising outright repeal if he wins. A few years ago, the health care law seemed a reason for Mr. Obama to risk losing re-election, former aides said. Now, it is a reason he feels he must win re-election.

As he awaits the decision, Mr. Obama has no more knowledge of or influence on it than any of the other lawyers handicapping the odds in Washington bars and boardrooms.

The former law professor turned president is scathing about the argument that the mandate violates the Constitution, saying it has no merit whatsoever. Sometimes, to the nervousness of advisers, he says as much in public; a few days after oral arguments, he laid down a gauntlet for the Supreme Court, all but saying that striking down the law would be politically motivated judicial activism. (He later softened his statement.)

“To have a voice as profound as the Supreme Court say it’s unconstitutional,” said Jonathan Gruber, an economist at the Massachusetts Institute of Technology who was an adviser on the law, would be “bad news all around.”

But there are clues that Mr. Obama is privately grappling with both the potential loss of universal health care and how much of it he might be able to restore. At a recent fund-raiser in Manhattan, he rattled off a second-term agenda, and along with tax reform and immigration, he mentioned coming back to health care, to work around a negative ruling. His tone was matter-of-fact, one attendee said.

If the court strikes down the mandate and Mr. Obama wins in November, he could face one last version of his perpetual choice on health care: would he settle, learning to live with a sharply edited law? (Given that Republicans see the bill as a signature piece of big-government overreach, he might have no choice.) Or would he expend yet more precious capital on health care?