This article is from the archive of our partner National Journal

Kay Hagan had done everything right. When Senate Democrats elsewhere got wrapped up in thorny national issues; she spent months talking only about local education funding. While some of her colleagues exhausted the "war on women" attack by September, the first-term incumbent kept that message quiet until it was fresh for October.  Other Democrats saw their poll numbers fall; she saw hers grow. She had run what one Democratic operative called a "damn near perfect campaign."

And none of it was enough. Because in 2014, all of the strategic brilliance and tactical deftness Democrats can muster doesn't look like a match for the deep unpopularity of President Obama.

Hagan lost Tuesday to Republican Senate nominee Thom Tillis, losing by a narrow margin in a year when many of her colleagues lost badly and her party lost the Senate majority.

It is a devastating defeat for Democrats, who had remained optimistic even when polls tightened that Hagan would pull through. Hagan had been an outlier most of the cycle: While other red-state Democratic incumbents looked doomed months ago, she opened a small lead against Tillis during the summer. Her campaign focused relentlessly on education cuts she said Tillis has approved of while state speaker of the House, a potent issue in its own right but also one that reminded voters that her opponent was a leader in the polarizing state Legislature.

Tillis, meanwhile, failed to gain traction. He had resisted pleas from national Republicans to step down as speaker, and consequently was tied down most of the summer during a contentious legislative session in Raleigh. It was then that he started to trail Hagan in the polls, an advantage she maintained almost until the very end of the race.

But by October Democrats started to worry that months of her good work were being unraveled by an onslaught of a toxic national climate. Hagan was talking less about education and more about ISIS and Ebola, issues that had intruded on Democratic races elsewhere. Suddenly Obama's deep national unpopularity, something that had dragged down her colleagues elsewhere, was having its own effect in North Carolina.

Some public polls tightened and Republicans declared they had seized momentum. Many of them were confident of victory, even if the Hagan campaign maintained throughout that they would win.

They were wrong. They had run a close to perfect race while Tillis's own campaign foundered. But in 2014, in North Carolina, the environment mattered more than campaigns.

This article is from the archive of our partner National Journal.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.