WASHINGTON — In the dark of night, when they get what little sleep they get these days, the people running the campaigns for president have more than enough fodder for nightmares. Worse, come daybreak, they realize their worst fears may yet come true.

Dancing in their heads are visions of recounts, contested ballots and lawsuits. The possibility that their candidate could win the popular vote yet lose the presidency. Even the outside chance of an Electoral College tie that throws the contest to Congress.

Now add to that parade of potential horrors one more: a freakish two-in-one storm that could, if the more dire forecasts prove correct, warp an election two years and $2 billion in the making.

Despite the meticulous planning, careful strategies, polling, advertising and get-out-the-vote efforts, the election could produce the sort of messy outcome that defies expectation and prognostication. Polls show such a tight race between President Obama and Mitt Romney heading into this final week that the two sides are playing out any number of wild possibilities.

The approach of Hurricane Sandy reminded them just how out of their control democracy can be.

"Obviously, we believe the more people participate in the election, the better," said David Axelrod, the president's senior strategist, "and the storm can be disruptive. But to the 50 million people in its path, there are more immediate and potentially grave concerns that transcend politics. We'll have to wait and see its impact."

The storm forced both candidates to and, with eight days until Election Day, will require Mr. Obama to balance the roles of president in an emergency and candidate. That could benefit or hurt him, depending on how voters view his performance, and distract from efforts by both camps to advance a closing argument.