Count President Obama among the viewers who were fooled by the erroneous early reports on cable television Thursday about the Supreme Court’s health care ruling.

View Photo Gallery: The Supreme Court’s decision Thursday is a major victory for the White House less than five months before the November election. The law will affect the health-care choices of millions of Americans.

According to aides, Obama was watching the live feeds on CNN and FOX on a split-screen television just outside the Oval Office that was broadcasting four different stations. At 10 a.m., those two stations reported that the court had ruled the individual mandate unconstitutional, overturning the centerpiece of the president’s signature legislative achievement.

Obama remained calm, senior White House officials said. He had reportedly already prepared remarks in case of a victory or defeat, so he was ready either way. Now, he thought he had lost.

Those stations still were reporting the wrong decision when White House counsel Kathryn Ruemmler entered the room with Chief of Staff Jack Lew within a minute and gave the president the thumbs up sign, the aides said. She explained that, in fact, the court had ruled 5-4 that the mandate was allowed under Congress’s taxing authority, and the health-care law would remain largely intact.

Ruemmler and Lew had been following SCOTUSblog, an independent blog that has gained a reputation for quick, accurate reporting. And another White House lawyer was stationed at the court to hear the decision.

Obama’s initial reaction was momentary cognitive dissonance, said the aides, who spoke on condition of anonymity to describe the private moment. But then he broke into a smile and hugged Ruemmler.

His first call was to Solicitor General Don Verrilli, who had argued the administration’s case before the court and had been widely criticized.

An enthused Obama thanked Verrilli for his service, the aides said.