BOSTON — The e-mail message from a Massachusetts supporter to one of the leaders of the Tea Party movement arrived in early December. The state was holding a special election to fill the seat held by Senator Edward M. Kennedy, it said, and conditions were ripe for a conservative ambush: an Election Day in the dead of winter with the turnout certain to be low.

“To be honest, we kind of looked at it and said, this is a long shot,” said Brendan Steinhauser, the director of state campaigns for FreedomWorks, which has become an umbrella for Tea Party groups. But the group was impressed by the determination of organizers in this decidedly Democratic state and was intrigued by the notion that this could be a way to effectively derail federal health care legislation.

And so FreedomWorks sent out a query to dozens of its best organizers across the country. Within days, the clamoring response made clear that what seemed improbable suddenly seemed very attainable; within weeks, the Tea Party movement had established a beachhead in Mr. Kennedy’s home state.

While conservatives quietly mobilized behind a state senator, Scott Brown, to fill the seat occupied by Mr. Kennedy for nearly 47 years, Democrats paid but slight attention to a contest that by every indication and by history should have been nothing to worry about.

The vastly different responses of the two parties contributed to a confluence of events that fundamentally altered the course of what should have been a routine special election.

In Washington, Senate Democrats had to engage in tawdry horse-trading to pass a staggeringly complex health care bill in the face of a Republican filibuster, displaying Congress at its partisan and dysfunctional worst.

Across the country, the bailouts of Wall Street and the banks, the big year-end bonuses for powerful executives, and the rapidly ballooning federal deficit were feeding populist anger and resentment of the Obama administration while providing the Tea Party movement with fresh energy and issues around which to organize.

Here in Massachusetts, Mr. Brown began introducing himself with a modest buy of television advertisements that would prove politically prescient: portraying himself as the outsider battling the Democratic Party establishment, in this case, Ms. Coakley.

It was less of a long shot than it seemed: The National Republican Senatorial Committee had, nine days before Christmas, quietly conducted a poll that found that among voters who seemed most likely to turn out, Mr. Brown was just 3 percentage points behind.

Ms. Coakley did almost nothing early on, lulled by the knowledge that Democrats had held the Senate seat for 57 years and emboldened by her 19-point win in a four-way primary. She disappeared from the trail for a few days of rest. Her campaign, struggling for cash, was not conducting polls in the very beginning of January, a critical period, and had yet to run a single commercial.

By the time Ms. Coakley’s campaign and Democratic officials noticed that things were not right in Massachusetts — after reading an outside group’s poll on Jan. 9 that showed Mr. Brown holding a 1 percentage point lead — the fire, as one White House official put it, was out of control. The Tea Party reinforcements had arrived, and a conservative group from Iowa started running commercials here portraying Ms. Coakley as a big spender who would raise taxes, a powerful issue with independents.

“It was a classic case of everybody getting caught napping,” David Axelrod, a senior adviser to the president, said in an interview. “This guy knew exactly what he was doing. He’s an appealing candidate. Pleasant guy. He’s smart. He tapped into an antipolitician sentiment.”

The two-week period that upended the politics of Massachusetts and the nation may well be remembered as the moment that undid the signature initiative of the Obama presidency, his health care bill. It is a story, based on interviews with more than three dozen people involved in the race, of missed opportunities and tensions among Democratic power centers here and in Washington.

But it also heralds the coming of age of the Tea Party movement, which won its first major electoral success with a new pragmatism, and the potential of different elements of a divided Republican Party to rally around one goal.

Mr. Brown’s views may not have been perfectly aligned with all of the conservative activists — in particular, he supports abortion rights, though he opposes late-term abortions — but he pledged to vote against the health care bill, opposed a cap-and-trade program to reduce carbon emissions and opposed proposals to grant citizenship to illegal immigrants. In the final week of the race, he raised $1 million a day on the Internet.

“For us, this is not so much about Scott Brown as it is about the idea that if we really collaborate as a mass movement, we can take any seat in the country,” said Eric Odom, executive director of the American Liberty Alliance, who helped organize last spring’s Tax Day Tea Party rallies to protest government spending from his home in Chicago.

For all the political power of the Democratic Party — its control of the White House and both houses of Congress — this contest highlighted serious flaws in its political operation heading into the tough midterm elections, from the political affairs office of the White House to the Democratic Senatorial Campaign Committee. It demonstrated the extent to which the White House was distracted by the exceedingly difficult task of passing a health care bill before the State of the Union address, along with dealing with an attempted terrorism plot on Christmas Day.

And for Congressional Democratic leaders already chafing at the political cost of Mr. Obama’s health care plan, it was confirmation that the bill could be deadly at the polls for any member of Congress in a competitive race next fall.

There were many missteps on the ground by Ms. Coakley — off-putting remarks and gaffes, local memories of problems in her tenure as attorney general, a seething sense among many residents that she was considering herself entitled to their votes. Many voters were as angry with the Democrats who have long run the state as they were with the ones in Washington, and they enjoyed a bit of nose-thumbing on Tuesday. But if there is one question on which there appears to be a consensus among Democrats today, amid a period of full-blown blame trading and recriminations, it is that the defeat of Ms. Coakley could have been prevented.

“If we had defined Scott Brown earlier, if we had been able to go up on the air earlier, if the Democrats had passed Wall Street financial reform in Washington,” said Celinda Lake, a pollster from the Coakley campaign, looking weary as she arrived on Tuesday night at the Sheraton Hotel in Boston for her client’s concession speech. “There are lots of things that we could have done.”

Photo

The outsider Scott Brown, who drove by supporters in his pickup Tuesday morning, portrayed himself as battling the Democratic Party establishment.Credit
Christopher Capozziello for The New York Times

A Dead Time

On the Sunday after Christmas, the senior members of Mr. Brown’s campaign gathered at his headquarters in Needham. It was a dead time of year, politically. Mr. Brown did not have a lot of money. Ms. Coakley’s strategy seemed clear: to coast to victory with a quick under-the-radar campaign. Democrats in Massachusetts and Washington were enjoying the holiday — she was resting up; the president’s chief of staff, Rahm Emanuel, was in India; Mr. Obama was in Hawaii — and few were paying attention to the long-shot state senator from Massachusetts.

By contrast, the National Republican Senatorial Committee zeroed in on the race — and the possibility to seize a victory — weeks before the Democratic committee realized its candidate was in real trouble. A poll conducted for Republicans on Dec. 16 showed that Mr. Brown was within 13 percentage points of Ms. Coakley and trailing by only 3 percentage points among voters who said they definitely intended to vote.

An error has occurred. Please try again later.

You are already subscribed to this email.

“It almost seemed too good to be true,” said Senator John Cornyn of Texas, chairman of the committee.

The absence at this critical juncture of the White House or the Democratic Senatorial Campaign Committee, led by Senator Robert Menendez of New Jersey, strategists in both parties say, was a turning point that touched off a series of mistakes from which the Coakley campaign would never recover.

Mr. Brown intensified the pace of his campaigning after that meeting in Needham. He began running biographical ads — one even featured a grainy image of a young John F. Kennedy — and turned up at campaign events across the state.

A review of Ms. Coakley’s schedules showed no public campaign events between a stop where she read Dr. Seuss to schoolchildren on Dec. 23 and an appearance in New Bedford on Dec. 30. Mr. Brown’s schedule that week, on the other hand, was full: a stop at a coat drive on Christmas eve, six stops scheduled for the day after Christmas, and seven more the day after.

Mr. Brown’s surge should not have been a total surprise. Ms. Lake, the pollster for Ms. Coakley, said early surveys conducted before the primary detected that “independents were an ornery lot in an angry mood.” But those surveys did not alter the campaign strategy for Ms. Coakley or set off alarm bells for Democrats in Washington.

“Everybody took their foot off the pedal more than they should have,” Ms. Lake said.

As Tea Party activists headed to Massachusetts, the National Republican Senatorial Committee made a deliberate decision to keep a low profile. It baffled and to some extent misled Democrats, who thought that the committee had concluded the race was unwinnable. But Republican officials, after a series of primary challenges from conservative and Tea Party candidates, have learned the dangers of being identified as an establishment candidate. They determined the best way to help Mr. Brown was not to be seen as helping him.

“We did not want to provoke the D.S.C.C. into a big spending battle too early, which would have allowed them to chip away at his positives in a way that they would have eventually won,” said Mr. Cornyn, often criticized by Tea Party groups as the embodiment of the establishment.

And Mr. Odom, with the American Liberty Alliance, had dismissed the race as unwinnable, too, until about 10 days ago, when the number of e-mail messages urging his group to jump into the race began to reach 50 a day. He sent out e-mail messages to the 60,000 people on the taxdayteaparty.com list, urging them to donate and he headed to Boston himself.

Indeed, there was a spirit of pragmatism emerging here that had not been seen in other races where conservative and Tea Party activists have become involved. “He’s the kind of Republican who will give conservatives heartburn, but it’s better than the other side,” said Erick Erickson, the editor of RedState.com. His Web site does not typically endorse any candidate who supports abortion rights. But by late December, it was posting almost daily appeals directing readers to Mr. Brown’s Web site to contribute.

A Blank Slate

The first wave of Democratic party operatives arrived in Massachusetts about two weeks before Election Day, only to find that it might have already been too late. Even at that late hour, some campaign strategists said they found gaps in basic procedures. The electronic database of voters was not updated, three party officials said, and there was no reliable voter identification list to find supporters among independent voters.

Dennis Newman, the chief strategist for the Coakley campaign, said it was “absolutely false” that there was no current voter database.

Mr. Newman said that the campaign had spent most of its money in the primary, which it had expected to be the tougher race, and then had trouble raising money when things tightened. When the race became a referendum on health care, he said, Ms. Coakley was put in the tricky position of defending a health care bill to voters in a state that already has near-universal coverage.

Whatever the reason, Ms. Coakley’s campaign took the stance of a front-runner, determining that the best way to defeat Mr. Brown was to ignore him. It had done relatively little to draw attention to his voting record and positions that could have halted his rise.

If the campaign had been viewed as competitive, Ms. Coakley might well not have left the trail for a few days, several Democrats said. More important, she might have used that critical period at the end of December and in the opening days of the New Year to run advertisements introducing herself to voters — who knew her only vaguely as the attorney general — and making the case for her candidacy. Instead, she decided it made more sense to wait until the final week to run her advertisements.

The result was that she was sort of a blank slate, and Mr. Brown’s small advertising buy, combined with the more ambitious attack advertisements financed by the Iowa group and others, were able to define her. Several Democrats here and in Washington expressed frustration that Ms. Coakley — who is not based in Washington and who as attorney general could easily have portrayed herself as the crusader working against corruption and special interests — permitted herself to be identified as the establishment.

Last Thursday, after the White House awoke to the danger, Mr. Axelrod called Mr. Newman, a senior adviser to Ms. Coakley, to ask what the White House could do to help; he was assured, as Mr. Axelrod later related the conversation to associates, that things were in place and that Ms. Coakley was wary about getting any more operatives from Washington.

Mr. Axelrod later expressed surprise to associates that the Coakley campaign had not requested a visit from Mr. Obama to help turn out Democratic voters who seemed underwhelmed by the candidacy. (Many black voters who were enthusiastic about Mr. Obama in 2008 failed to vote on Tuesday.)

The next day, with new polls showing the race was virtually tied, Ms. Coakley called Mr. Axelrod and asked if Mr. Obama would come to Boston.

There was some debate about whether Mr. Obama should make this trip. Some of Mr. Obama’s advisers warned that the president would suffer political damage if he went and lost. Others said they thought the visit would reinforce Mr. Brown’s message that Ms. Coakley was the tool of Washington. But as Mr. Obama contemplated the stakes of a loss — starting with his health care bill — it was determined there was no other choice.

The president, described by associates as increasingly distressed about the campaign, headed to Boston Sunday for a rally in which he could barely hide his discomfort. Mr. Obama all but pleaded with Democratic voters to be more “fired up” than they were in 2008. But two days later, his call went unanswered.

Kitty Bennett contributed reporting from Washington.

A version of this article appears in print on January 21, 2010, on Page A1 of the New York edition with the headline: How the G.O.P. Captured a Seat Lost for Decades. Order Reprints|Today's Paper|Subscribe