WASHINGTON (CBS) – It’s been nearly seven years since the 2010 Senate special election in Massachusetts, but President Barack Obama hasn’t forgotten the Bay State race that could have had huge implications for his presidency.

At the time, Democrats were expecting Attorney General Martha Coakley to cruise to victory against a then little-known Republican named Scott Brown so they could hang on to their supermajority in the Senate and pass the Affordable Care Act.

Of course, that’s not how things turned out. In a new interview with New York Magazine, Obama recalls the moment he knew Coakley was in trouble.

“Well, the first thing that’s happening is I’m talking to Rahm [Emanuel, then chief of staff], and Jim Messina [then deputy chief of staff] and saying, ‘Okay, explain to me how this happened,’” Obama told the magazine. “It was at that point that I learned that our candidate, Martha Coakley, had asked, rhetorically, ‘What should I do, stand in front of Fenway and shake hands with voters?,’ and we figured that wasn’t a good bellwether of how things might go.”

The president was referring to a fateful Coakley quote printed in a Boston Globe interview from January 2010, where the attorney general, accused of being too passive in the special election, contrasts her style of campaigning with Brown.

“As opposed to standing outside Fenway Park? In the cold? Shaking hands?” she says, apparently referencing a Brown ad of him doing just that.

“By the time I flew in to do an event, it was already clear that there were going to be problems there,” said Obama, whose last-minute rally with Coakley at Northeastern University wouldn’t be enough to save her from defeat.

President Obama and Martha Coakley rally at Northeastern University in January 2010 (Photo by Saul Loeb/AFP/Getty Images)

President Obama and Martha Coakley rally at Northeastern University in January 2010 (Photo by Saul Loeb/AFP/Getty Images)

The president was still able to pass Obamacare with some careful legislative maneuvering, and he says the upset in such a reliably blue state taught him to always have a Plan B.

“We just didn’t pay a lot of attention to politics that first year, and the loss in Massachusetts reminded me of what any good president and any good elected official needs to understand: You’ve got to pay attention to public opinion, and you have to be able to communicate those ideas,” Obama said.