Updated

President Obama will travel to Massachusetts Sunday to try to save Martha Coakley's flagging campaign from an upset loss to Scott Brown, the Republican whose surging candidacy has stripped away the sense of inevitability Coakley once had in the race for the late Sen. Ted Kennedy's former seat.

The White House had been playing coy over the possibility of such a visit, saying it wasn't in the cards as Coakley floated hints in the press that she wanted the president to campaign for her. Former President Bill Clinton and Sen. John Kerry were holding a rally for the Democratic candidate Friday, but Coakley, the state attorney general, is looking for a last-minute push to try to keep Brown's campaign at bay.

White House Press Secretary Robert Gibbs said Friday that Obama believes his visit will be "productive."

"I think it's a referendum on whose side are you on," Gibbs said, dismissing suggestions the race is a referendum on the president himself. "I think the president sees a pretty clear distinction between a candidate in Martha Coakley who's going to fight for Massachusetts and a candidate on the other side who feels comfortable fighting for the insurance industry and big banks."

A spokeswoman for Brown, in response to Obama's planned visit, called Coakley a "rubber stamp for the political machine."

More On This...

With the election set for Tuesday, polls show the race is now a dead heat, and the most recent survey has Brown leading by 4 points. The Republican state senator has all the momentum -- he's reportedly raising money at a rate of $1 million a day -- and there's no shortage of criticism in political circles for the way Coakley and her allies have run her campaign.

Just one month ago, Coakley was considered a shoo-in to claim the U.S. Senate seat formerly held by Kennedy.

"Who could have foreseen this a month ago? ... This is absolutely amazing," said Larry Sabato, director of the University of Virginia Center for Politics. "(Coakley's) problem is they've got to motivate Democrats."

Coakley's campaign has been plagued by missteps, big and small, that may have given Brown an opening.

She's been broadly criticized for not being aggressive enough, particularly when Brown's campaign put up a brazen ad late last month comparing his campaign for a Democratic seat to John F. Kennedy's campaign nearly 60 years ago for what was then a Republican seat.

Asked if her campaign was going too soft, Coakley may have made another blunder.

"As opposed to standing outside Fenway Park? In the cold? Shaking hands?'' she told The Boston Globe, in what appeared to be a reference to Brown's campaigning style.

Former Red Sox pitcher Curt Schilling, a figure of considerable stature in baseball-mad New England, picked up on that line and blasted Coakley as an elitist who wasn't trying hard enough to win the seat.

"She's apparently been trying to win the title of Worst Political Campaign Ever, and she might have just clinched it with her little dig at Scott Brown over Fenway Park," Schilling wrote on his blog.

The Democratic Party's heavy hitters, meanwhile, have kicked into overdrive, with top senators appealing to supporters for donations and traveling to Massachusetts.

Democrats warn that a Brown win could torpedo health care reform and other Obama administration initiatives, since he would break the Democrats' 60-vote, filibuster-proof majority in the Senate. "This is our wake-up call," Kerry said in a recent fundraising e-mail.

"Martha's vote is critical to getting health care and the rest of President Obama's agenda passed," Kerry wrote.

But Murphy's law seems to have prevailed over the past week.

-- A Coakley supporter knocked over a reporter from the Weekly Standard in full view of the cameras outside a Washington fundraiser Tuesday. Coakley said she didn't see it, but a photograph of the incident appeared to show her looking in the direction of the reporter when he fell. Her supporter later apologized.

-- Coakley was quoted at that fundraiser saying a loss in Massachusetts would be "hell" for Democrats in the 2010 elections. She denied she said it, but observers in the room confirmed that she had.

-- Coakley's campaign even misspelled Massachusetts in one of her ads, an error quickly pointed out by Republicans.

Before deciding to visit the state this weekend, the president did come to Coakley's aid by cutting an online video for her, calling on supporters to put on their "walking shoes" and bring out people to vote.

"In Washington, I'm fighting to curb the abuses of a health insurance industry that routinely denies care," Obama said. "I'm fighting for financial reforms to stop Wall Street from playing havoc with our economy. I'm fighting to create a new, clean energy economy.

"And it's clear now that the outcome of these and other fights will probably rest on one vote in the United States Senate."