DES MOINES — Late Monday night, supporters of Hillary Clinton gathered for what they expected would be a victory rally.

Over the weekend, her campaign had exuded confidence, with some advisers predicting she would win the Iowa caucuses by several percentage points, and by Monday evening, they were urging news outlets to call the race in her favor. Mrs. Clinton prepared a victory speech in which she virtually ignored her rival, Senator Bernie Sanders of Vermont, and attacked the Republican candidates.

Then the caucus results started rolling in. And everything changed.

The outcome in Iowa — which at least until Tuesday afternoon appeared to be effectively a tie with a far left senator from a small New England state — dealt a jolting psychological blow to the Clinton campaign, leaving volunteers, donors and aides confused throughout the night, and then crestfallen. They had hoped that the former secretary of state would garner a decisive victory here and put to rest any doubts about her strength as a candidate.

Instead, they now head to New Hampshire, where Mr. Sanders is heavily favored in the polls, and brace themselves for another battle before they reach more hospitable states like Nevada and South Carolina.