At the Jan. 17 Democratic debate in Charleston, S.C., Democratic front-runner Hillary Clinton went out of her way to stress her ties to President Obama. (Peter Stevenson/The Washington Post)

Hillary Clinton had a clear strategy going into Sunday night's fourth Democratic presidential debate: Hug President Obama — at all costs.

"We have the Affordable Care Act," Clinton said. "That is one of the greatest accomplishments of President Obama, of the Democratic Party, and of our country."

"I'm going to defend Dodd-Frank and I'm going to defend President Obama for taking on Wall Street, taking on the financial industry and getting results," she said.

"I was very pleased that leaders of President Obama's administration went out to Silicon Valley last week and began exactly this conversation about what we can do, consistent with privacy and security," she said.

That's a sound tactical move in the context of a Democratic primary — particularly when trying, as Clinton is, to slow Bernie Sanders's momentum among liberals and avoid allowing him any momentum with black and Hispanic voters. All three of those groups remain some of the most loyal supporters of Obama, so praising him makes sense.

But it also represents a marked shift in Clinton's rhetoric on Obama. Remember back to last fall when Clinton was fond of saying: "I'm not running for my husband's third term. I'm not running for President Obama's third term. I'm running for my first term."

That phrasing was born of a desire to ward off Republican attacks on Clinton in a general election. She — and her team — knew that, among critical independent voters, being regarded as simply an extension of Obama's eight years in office is very problematic.

What changed? Sanders's poll numbers, which now suggest he is in a dead heat with Clinton in Iowa and ahead of her in New Hampshire. Clinton no longer has the luxury to keep a polite distance from Obama to stave off general election attacks from Republicans. She now knows she faces the possibility of not making the general election, so plotting and planning for that race has to be put on hold.

That shift comes with a cost, of course. And the cost is that Republicans now have Clinton, in her own words, praising Obama on, well, everything, during Sunday night's debate.

Splice the three quotes I started this piece with into a TV ad. Throw in a visual or two of Obama and Clinton laughing or hugging. And whammo! You've got a terrific negative ad that puts lie to Clinton's past insistence that she won't simply be a continuation of Obama's policies.

Now Republicans were already making that attack. And with or without Clinton's strong defense of Obama on Sunday night, Republicans were going to keep making it. But the strongest (read: most effective) ads in this cynical time are the ones featuring the candidate herself saying things that seem to contradict other things she's said.

Clinton handed that ad to Republicans on Sunday night. She might have had to do it — you can't win the general election if you can't get to the general election — but it comes with a major downside that Clinton will feel if she is the Democratic nominee this fall.