It was a hair-raising evening for Representative Christopher Shays, a Republican who fended off sharp attacks by his Democratic opponent, Diane Farrell, the first selectwoman of Westport.

Early results showed him trailing Ms. Farrell, who had tried to paint him as a conservative of the same ilk as Representative Tom DeLay, the House majority leader. But returns from Republican-leaning towns like Greenwich and Trumbull turned the tide.

In his victory speech, Mr. Shays revealed that internal polls had shown him losing the race just two weeks before the election, which may explain why he was at Grand Central Terminal on Monday evening, greeting surprised commuters heading home to Fairfield County.

While the Shays-Farrell race turned into an unexpectedly hot contest, the nasty House battle between Rob Simmons, the Republican incumbent, and Jim Sullivan, a former Norwich councilman, was more tepid than predicted. Mr. Simmons easily defeated Mr. Sullivan for eastern Connecticut's seat, thanks in part to help from the Republican National Congressional Committee, which underwrote a harsh advertising campaign.

Senator Christopher J. Dodd, a Democrat, won a fifth term, a first for a Connecticut senator. Mr. Dodd, 60, spent some $5million to defeat a Republican newcomer, Jack Orchulli, a former fashion industry executive who spent more than $1.3 million on his campaign.

With the defeat of Senator Tom Daschle of South Dakota, who is the Senate minority leader, Mr. Dodd is considered a leading contender for a top Senate leadership position. His name has also surfaced on lists of potential candidates for governor and president.

Senator Kerry won Connecticut's seven electoral votes, even though he, like President Bush, never campaigned in the state.

Senator Kerry won in Delaware, where Gov. Ruth Ann Minner, a Democrat, was elected to a second term. She defeated Bill Lee, a former Superior Court judge, who was the Republican candidate.

Ms. Minner and Mr. Lee sparred over the economy, the environment and education, in particular the state's testing program and an unusual three-tiered high school diploma system that has been put on hold. Perhaps the most contentious topic was the state's prison system, with the governor drawing criticism for her handling of a case in which a prison counselor was abducted and raped.

Ms. Minner, a twice-widowed mother of three who left high school to help support her family but later went back for an equivalency degree, is the state's first female governor. In the end, she was able to win over voters, but the results were closer than early polls had suggested -- a fact that Mr. Lee mentioned in his concession speech.

Ms. Minner won with 51 percent of the vote to Mr. Lee's 46 percent, in the state's closest governor's race since 1972.

Marion S. Barry Jr., the former mayor who was caught on tape by the F.B.I. smoking crack cocaine in 1990, resurrected his political career by winning a City Council seat. "It's not a comeback," Mr. Barry told reporters at a victory party. "It's a coming out of retirement." Mr. Barry, who won by a wide margin, will represent one of the district's poorest neighborhoods.

Maine voters swung solidly behind Senator Kerry, a fellow New Englander, even though the Bush family has long had a home in the state. Maine is one of two states that can divide its electoral votes, but Mr. Kerry carried both Congressional districts and therefore won all four electoral votes.

The state's House members, both Democrats, were easily re-elected. Representative Tom Allen, whose district includes Portland and Augusta, won a fifth term, trouncing Charlie Summers, a former state senator. In the huge Second District, covering northern Maine, Representative Michael H. Michaud won a second term.

Two ballot propositions went down to defeat. A proposal to set a statewide limit on property taxes was overwhelmingly rejected, after state and local officials warned that it would force cuts in school budgets and municipal services. But Gov. John Baldacci, a Democrat, got the message and said he would offer a tax relief plan.

Voters also rejected a proposal to outlaw the hunting of bears with bait, traps or dogs. Hunters and state officials opposed the ban, saying it would cause economic harm, while supporters ran television advertisements that portrayed bear hunting as cruel.

Senator Kerry won the state by almost the same margin Vice President Al Gore had four years earlier. The popular Democratic Senator Barbara A. Mikulski was re-elected by a 30-point margin. And every incumbent in the House delegation won easy re-election.

Ms. Mikulski said Tuesday night that her victory was proof that Maryland, despite electing a Republican governor in 2002, was still terra firma for Democrats. Her victory takes her to a fourth term.

The race between Ms. Mikulski and her Republican challenger, E.J. Pipkin, often sounded like a page cribbed from the presidential campaign. Mr. Pipkin, who sunk $1 million of his own money into the campaign, attacked Ms. Mikulski for her votes to raise taxes and to oppose the Iraq war.

Mayor Martin O'Malley of Baltimore was re-elected with 88 percent of the vote, a win that sets him up for a run for governor in 2006. Mr. O'Malley, a Democrat, has built a reputation working to reduce crime and revive the city.

There were no surprises in Massachusetts, with Senator Kerry capturing 62 percent of the vote in his home state. The state's 10 representatives seeking re-election, Democrats one and all, also coasted to victory. Four ran unopposed.

For some Democratic politicians, there was a particularly personal dimension to the disappointment of President Bush's win.

In the months leading up to the election, there had been much discussion of the special election that would have been held to fill Mr. Kerry's Senate seat, had he won the presidency. It would have been the state's first open Senate seat since 1984, when Mr. Kerry won the race to succeed the ailing Paul Tsongas.

Among those who had been talked about for the position were Representatives Barney Frank, Edward J. Markey and Martin T. Meehan.

For the first time in nearly eight decades, a challenger unseated the incumbent candidate for governor, with John Lynch, a Democrat, getting 50.8 percent of the vote, less than 2 percent more than Gov. Craig Benson. The outcome was uncertain until early yesterday, long after it became clear that Senator Kerry had won the state.

Mr. Benson came into office two years ago, promising not to add or raise taxes. He kept the promise but was plagued by charges of cronyism, and several members of his staff resigned amid ethics scandals. The race had been just hairs apart in the polls for weeks, with the candidates relying heavily on money from their own pockets -- Mr. Lynch spending $1.3 million of his own and Mr. Benson $1.4 million. Mr. Benson, a businessman without much experience in government, said he would probably retire from politics.

Mr. Lynch was aided by a record voter turnout. New Hampshire had long been considered a battleground in the presidential campaign, and the theory was proved on Tuesday. Mr. Kerry won 50 percent of the vote, just 9,171 votes more than President Bush, who won 49 percent. Ralph Nader received 1 percent of the total.

With nearly 680,000 votes cast, turnout beat the record of 578,000 set in 2000, when the state's four electoral votes went to Mr. Bush by a margin of one percentage point. Had Vice President Al Gore won in New Hampshire, he would have had the majority of electoral votes.

Voters who said they considered themselves moderate or independent supported Mr. Kerry by a margin of nearly two to one, according to surveys. The war in Iraq was clearly a major factor -- about half of the voters questioned said they disapproved of the war and nearly all of those gave their votes to Mr. Kerry.

Senator Judd Gregg, a Republican, got two-thirds of the vote and defeated the Democratic challenger, Doris Haddock, also known as Granny D. Ms. Haddock gained national attention in 1999 when she walked across the country to rally for campaign finance reform.

Senator Kerry easily carried New Jersey, but President Bush received 300,000 more votes this year than he did in 2000.

Asked whom they would trust to handle the terrorist threat, voters were almost as likely to say Mr. Kerry as Mr. Bush. Only one-fourth of voters said that terrorism was the most important issue influencing how they voted.

Nearly 700 New Jersey residents were killed in the attack on the World Trade Center, but Democrats said the state's voters did not accept the White House's contention that they were being protected from terrorism by the Bush administration.

Mr. Bush outpolled Mr. Kerry among whites. In surveys of voters leaving the polls, black voters overwhelmingly favored Mr. Kerry, but more than one-third of Hispanics expressed support for Mr. Bush.

Mr. Kerry did particularly well among first-time voters and those under 30.

Even Senator Charles E. Schumer's most loyal partisans did not predict the magnitude of his re-election victory over Assemblyman Howard D. Mills, which set state records for most votes, highest percentage of the vote and largest winning margin.

The victory by Mr. Schumer, a Democrat, was all the more striking in that Senator Kerry's victory here fell short of Al Gore's and Bill Clinton's margins in the state.

The results will fuel the already widespread talk that Mr. Schumer might run for governor in 2006, talk he has done nothing to dampen. That could set up a fierce primary clash with another popular Democrat, Attorney General Eliot Spitzer.

An error has occurred. Please try again later.

You are already subscribed to this email.

"Running up the score is a great send-off if you want to run for something else," said Lee M. Miringoff, director of the Marist College polls. "Schumer comes out of this with great strength in every part of the state. Of all the Democrats around the country, he's in as good a position as anybody."

Another closely watched race in New York, to represent the Buffalo area in Congress, remained too close to call. With most votes counted, Assemblyman Brian Higgins, a Democrat, led Nancy Naples, the Republican Erie County comptroller, by less than 2 percent. Jack Quinn, a Republican, vacated the seat, giving Democrats one of their best chances nationally for a gain.

Republicans held on to another open House seat, as State Senator Randy Kuhl defeated Samara Barend, a Democratic newcomer, to succeed Representative Amo Houghton, who is retiring. The race was roiled by the release of Mr. Kuhl's divorce records, which were supposed to be sealed. They included allegations that he had waved shotguns at his wife. The news backfired when it was revealed that it was Ms. Barend's campaign manager who had obtained the records from the court.

All House members seeking re-election won handily. But several state legislators were defeated, an unusual turn in this state, as Democrats made gains in both houses. Challengers made inroads this year by calling incumbents part of a dysfunctional culture in Albany.

Throughout the campaign, Pennsylvania was a virtual home-away-from-home for President Bush and Senator Kerry as they spent considerable time and vast resources wooing a state they both argued was crucial for victory.

While Mr. Bush did not win it (for the second time), Mr. Kerry might have conceded Tuesday night without it.

Yet postelection surveys suggested that much of the candidates' efforts in the final weeks were superfluous, as nearly 80 percent of voters said they had made up their minds before the final month of the campaign.

Mr. Kerry's success was built on the kind of solid calculation that eluded him elsewhere: he ran stronger than Mr. Bush among women, blacks and Hispanics, the youngest of voters, the oldest and large majorities who believed the economy was "not so good" or poor. He also ran much stronger in Philadelphia and Pittsburgh than in most other places in the state.

But as a reflection of Mr. Bush's strength across the country and the central themes of his campaign, Mr. Kerry was not the choice of voters who said terrorism or moral values was the issue that most determined how they voted.

Senator Arlen Specter, a moderate Republican who fended off a fierce primary challenge from a House conservative, waited out Representative Joe Hoeffel's early lead to overtake him in the late hours and win by 11 points (53 percent to 42 percent), securing a fifth term.

"This victory is an important symbol for the moderate wing of the Republican Party," Mr. Specter said in victory, a message as much for his supporters as for Senate conservatives, who outnumber those Republicans who sometimes vote with Democrats.

Two minor-party candidates shared the remaining 5 percent of the vote.

Mr. Hoeffel, a three-term House Democrat, proved to be no match for Mr. Specter's deep familiarity among voters, as evidenced by the senator's winning 28 percent of the Democratic vote and scoring a two-point edge, 47 percent to 45 percent, among independents, according to voter surveys.

Mr. Specter, who is 74, was also the clear choice among all voters over 29 years old and a majority of those with annual incomes above $30,000.

Pennsylvania's House races provided a dash of drama but no seat changes. The state's three open seats were filled by candidates from the same party, and in a sign of the noncompetitive nature of most House races these days, two incumbents ran unopposed, and six others won with 86 percent of the vote or more.

Rhode Island and its four electoral votes stayed firmly in the New England pro-Kerry block. Senator Kerry won 60 percent of the vote to President Bush's 39 percent, with 1 percent going to Ralph Nader. Rhode Island has voted Democratic in every presidential race since 1984.

Mr. Langevin won a third term and Mr. Kennedy a sixth, defeating a former Navy Seals member named Dave Rogers, who lost to Mr. Kennedy a second time in a row.

The race was one of the 10 most expensive House elections, with the two campaigns raising a combined $3.8 million. But it was a less contentious race than the one two years ago.

"I think that both of us were able to be very civil and give Rhode Islanders a clear choice," Mr. Rogers told The Associated Press on Election Day. Senator Kennedy campaigned for his son on Tuesday. Representative Kennedy, 37, entered politics at 21 by winning a seat in the State General Assembly. He has represented the state's First District for 10 years.

Gov. Jim Douglas, a Republican, was re-elected by a comfortable margin after a spirited contest with Peter Clavelle, the mayor of Burlington.

Keeping true to their reputation of refusing to rigidly toe any party line, Vermonters elected Democrats, Republicans and independents.

As expected, Senator Kerry won the state convincingly, by roughly 20 percentage points. However, the turnout for him had virtually no impact on the race for governor, despite repeated attempts by Mr. Clavelle, a Democrat, to link Governor Douglas and President Bush and the war in Iraq. In the end, the governor won by a margin of 21 percentage points.

Mr. Douglas acknowledged the vagaries of party affiliation in the state, telling supporters that he planned a "mainstream" and "bipartisan" administration.

"Vermonters appreciate the hard work we've done," he said in his victory speech. "With the help of all of you in this room, I look forward to providing leadership to this state, helping all Vermonters fulfill the promise of Vermont."

The campaign, which featured a series of debates that provided a chance for voters to hear more than just clipped sound bites, offered a clear choice in governing ideologies.

Mr. Clavelle was, until recently, a member of the Progressive Party, which is more liberal than the Democrats on many issues. He changed party affiliation to run for governor but was nonetheless identified with the Progressive Party throughout the race.

While Mr. Douglas mostly steered clear of direct criticism of his opponent, he did finance a series of ads that portrayed Mr. Clavelle as an out-of-the-mainstream tax-and-spend liberal.

Mr. Douglas focused his campaign on a pro-business record, support for economic development and more funds for antidrug programs. He also showed that he was not afraid to break with the national Republican Party. For instance, he was harshly critical of the Bush administration's environmental record. That stance helped him fend off Mr. Clavelle's attempt to link him with Mr. Bush.

It was one of the states most visited by President Bush and Senator Kerry in the campaign, but West Virginia ended up being nothing close to a battleground, supporting Mr. Bush by a margin that would have been unimaginable when President Bill Clinton sailed to easy victories there in 1992 and 1996.

Reflecting concerns over foreign attacks and jobs, nearly 30 percent of Democrats joined overwhelming numbers of Republicans who cited terrorism, moral values and the economy as the major reasons for supporting Mr. Bush over Mr. Kerry, according to surveys of voters.

The polls also showed that more than a majority of voters in the state, 56 percent, said they approved of the way the president was handling his job, and 58 percent said they felt the country was safer from terrorism than it was four years ago.

It was the second time Mr. Bush carried the state, after defeating Al Gore by six percentage points in 2000.

Democrats did not, however, abandon other Democratic candidates in large numbers. Both of the state's Democratic House members -- Representatives Alan B. Mollohan and Nick J. Rahall II -- were safely re-elected to Congress. The lone Republican, Representative Shelley Moore Capito, shook off a Democratic challenge from Erik Wells, a former television anchor, to keep her seat.

Democratic loyalties also helped Joseph Manchin III, West Virginia's secretary of state, win the governor's race, succeeding Bob D. Wise, a Democrat who did not seek a second term. Mr. Manchin, who ran unsuccessfully for governor in 1996, won 63 percent of the vote in defeating Monty Warner, a Republican, who had 34 percent, and Jesse Johnson of the Mountain Party, who had 2 percent.

Mr. Manchin was aided by name recognition -- an uncle had served as secretary of state and state treasurer -- and by an overwhelming advantage in money. In the final weeks of the campaign, he spent $3.3 million, compared with $880,000 by Mr. Warner.

Correction: November 5, 2004, Friday A chart in the elections section yesterday showing New York State returns for president and United States senator gave an outdated party affiliation for Ralph Nader. He was the candidate of both the Independence Party and the Peace and Justice Party; the Green Party was his affiliation in 2000.