President Bush and challenger John F. Kerry struggled last night for the crucial edge in a handful of battleground states in an election that reflected the deep-seated social divisions and polarizing effects of Iraq, the economy and the war on terrorism.

The basic alignments of the electorate echoed those of 2000, according to exit polls taken yesterday. Men, whites, rural residents and the religiously observant were backing Bush, while women, minorities, urban dwellers and the less religious were going for Kerry. Among Kerry's best hopes last night was an apparent breakthrough among young voters.

The close battlegrounds were those that the rivals had targeted for their most intensive campaigning and organizational efforts. New Hampshire was the lone unknown in the Northeast last night after Pennsylvania fell into line with its Democratic neighbors. Left to tip the balance were Ohio, Michigan, Minnesota, Wisconsin and Iowa in the Midwest, Nevada and New Mexico in the Southwest, and the tourist havens of Florida and Hawaii.

With Bush running as an incumbent who had triggered and endured four years of political battles, and with Ralph Nader less of a factor than he had been in 2000, the ideological alignments were more evident than they had been four years ago. About eight in 10 self-described conservatives supported Bush, while an even higher proportion of liberals backed Kerry. In 2000, about 6 percent of the liberals supported Nader, which cost the Democratic nominee, Vice President Al Gore, critical votes -- and perhaps some states.

The most significant shift, however, came among moderates. In this polarized political climate, their share of the electorate dropped from about 50 percent in 2000 to about 45 percent this year, but the margin for the Democratic nominee increased from eight percentage points then to about 15 points now.

Political independents were also moving to the Democrats, with Kerry winning a slight majority where Gore had lost by a similarly small margin.

F. Christopher Arterton, an elections expert at George Washington University, said it suggests that for all the attention both sides paid to turning out their bases of loyal supporters, "the people in the middle may turn out to be the key to this election. It would be ironic," he said, "if the first President Bush, who geared his policies to moderates and was punished by his party's conservatives, saw his son defeated for following exactly the opposite approach."

But as Bush battled to repeat his first-term wins in Ohio, Nevada and other closely contested states, it was by no means clear that Kerry could profit from the massive organization drive his party and its allies mounted.

In 2000, no national issue -- foreign or domestic -- had the power to shift large numbers of votes. Two-thirds of those who voted said the country was heading in the right direction, and no issue was mentioned by as many as 20 percent of the voters. The biggest personal factor in the election was the disapproval of departing President Bill Clinton as a person, voiced by six out of 10 voters, and they voted for Bush by better than 2 to 1.

This year, Clinton disappeared as a drag on the Democratic ticket -- as reflected in Kerry's decision to invite him to campaign this past week in several battleground states. But more voters said the country is seriously off on the wrong track than moving in the right direction. Iraq, terrorism, moral values and the economy -- all were of concern to voters, tugging them in different directions.

One voter in five said moral values were the most important issue driving the vote, and almost eight out of 10 backed Bush. Terrorism was almost as high in importance, and 85 percent of those voters also supported the president. Kerry found his strongest support -- more than 80 percent -- among those who named the economy and jobs and the war in Iraq as their most important concerns.

The decision to invade Iraq split the electorate almost evenly, according to the polling, although more think it is going badly than going well. The two groups voted in opposite directions by proportions of more than 80 percent.

These issue splits were overlaid on a foundation of an electoral map displaying deep social divisions in the country. Despite some pre-election polls suggesting that Bush might double his share of the black vote, nine out of 10 of those votes were going once again to the Democratic nominee, polls showed.

The number of blacks turning out appears to have been higher this year. If the exit poll for Pennsylvania is an accurate indication, African Americans made up about 13 percent of the electorate -- almost double their share in 2000. Democrats had mounted a massive registration drive in Philadelphia, only to see it countered by an increased Republican vote in mid-state rural counties.

Kerry was also winning a clear majority of Latino voters, claiming more than half their votes and beating Bush by 15 percentage points, surveys showed. Bush may have run better among Hispanics than he did four years ago, but Simon B. Rosenberg, head of the New Democratic Coalition, which began a targeted media campaign in Florida and other states years ago, said the results in that state broke the pattern of complete GOP domination of the Cuban American vote.

Joe Garcia, a leader of that community and Kerry supporter, said Bush paid a political price for imposing new restrictions on travel and cash remittances to Cuba.

Overall, white voters were favoring Bush by about 54 percent to 44 percent -- similar to his 2000 margin.

The gender gap persisted this year, but shrank a little. Bush was leading by about five percentage points among men, down from 11 points in 2000, while among women Kerry held about a nine-point advantage, two points less than Gore enjoyed four years ago.

In some key states, the gender gap closed almost entirely. In Ohio and Pennsylvania, a majority of men voted for Kerry, reversing the 2000 exit poll result. Bush also lost ground among men in Florida but still held the lead. In all three states, Kerry led among women.

Republican fears that the flow of the news was working against Bush appeared to be confirmed by the exit polls. Those who said they decided during the final week -- about one out of nine voters -- went for Kerry by 10 points. Despite a video message from Osama bin Laden that some Democrats feared would move voters to Bush, the headlines about kidnappings, bloodshed in Iraq seemed to have had a stronger effect in the other direction.

Another notable feature of the election was the Kerry edge among voters younger than 30. Their ranks grew as much as those of older voters, who usually are much more reliable in showing up at the polls. And those between 18 and 29 -- one-sixth of the electorate -- were going for Kerry by 13 points last night.

In Palm Beach County, Fla., Barry Cohen, front left, and Karen Marcus canvass signatures on absentee ballots as observers look on.