Mr. Gasparoni, who has lived here all his life and works as a tax manager for a medical device company, said that he had never campaigned for anyone before, but that he was moved to act because he was upset about the state’s decision to raise its sales tax, was leery of the health bill in Congress and was fed up with the scandals involving several Democratic state lawmakers.

“I think people have had enough,” Mr. Gasparoni said.

States do not get much more Democratic than Massachusetts. Democrats hold every statewide office and control both houses of the legislature with lopsided majorities. The state’s entire Congressional delegation is Democratic.

But Massachusetts does not always live up to its national stereotype as a bastion of liberalism. Yes, it was the only state to vote for George McGovern for president in 1972, but it also voted twice for Ronald Reagan. Democratic enrollment has fallen from 48 percent of the electorate in 1984 to 37 percent last year. And thanks largely to votes from independent voters in the suburbs, Massachusetts was led by Republican governors for 16 straight years, until Gov. Deval Patrick, a Democrat, broke the streak with his 2006 landslide election. Now Mr. Patrick is dealing with slipping approval ratings as he seeks re-election.

In tough times like these, the political hegemony of the Democrats has its risks.

“The Democrats are controlling both Washington and Beacon Hill,” said Joseph Malone, a Republican who served as the state treasurer during the 1990s. “So if I’m angry as hell about what’s going on with our government, who am I going to throw out? Who am I going to vote against? That’s a big part of this race.”

Several political analysts said that it was still possible  some said it was even likely  that Ms. Coakley, the state’s attorney general, would win on Tuesday, particularly if Mr. Obama’s visit helps turn out the Democratic faithful in strongholds like Boston and if Ms. Coakley is able to hold down Mr. Brown’s margins among independents.

But independent, suburban voters in several other parts of the Northeast voted Republican in November after trending Democratic for years, ousting Gov. Jon Corzine of New Jersey, a Democrat, and unexpectedly returning Nassau County, on Long Island, to Republican rule.