DES MOINES — Hillary Clinton and Senator Bernie Sanders of Vermont were locked in an intensely tight race in the Iowa caucuses on Tuesday as Mrs. Clinton’s strong support among women and older voters was matched by the passionate liberal foot soldiers whom Mr. Sanders has been calling to political revolution.

The close results were deeply unnerving to Mrs. Clinton and her husband, former President Bill Clinton, as well as her advisers, some of whom had expressed growing confidence in recent days that they had recaptured political momentum after weeks when Mr. Sanders was drawing huge crowds and rising in the polls. The Clintons had appeared optimistic at rallies over the weekend, thanking Iowans for their support as much as urging them to turn out to vote.

The close vote means that Mrs. Clinton and Mr. Sanders are likely to split Iowa’s share of delegates to the Democratic convention, and Mr. Sanders will be able to argue that the Iowa result was a virtual tie.