In a stunning catch-up, the Illinois senator seeking the Democratic presidential nomination is now just 2 percentage points behind Sen. Hillary Clinton of New York, a new Field Poll finds, within the margin of error.

Clinton’s lead among likely Democratic primary voters, which stood at 12 percentage points two weeks ago, has all but evaporated as voters here digested Obama’s lopsided victory in South Carolina last weekend and high-profile endorsements by Sen. Ted Kennedy of Massachusetts and Caroline Kennedy. Clinton still leads Obama, but just barely at 36 percent to 34 percent.

Obama’s success in California has not been much at Clinton’s expense. Clinton has lost only 3 percentage points, while Obama has gained 7 points since the Field Poll two weeks ago.

On the Republican side, the race is gaining clarity. Sen. John McCain of Arizona doubled his lead from two weeks ago over former Massachusetts Gov. Mitt Romney, and now leads by 8 percentage points.

Despite Obama’s surge, the poll shows a surprising number of voters in both parties are still in a quandary. An unusually high number said they are undecided: 18 percent of those voting in the Democratic primary, 15 percent among Republicans, said Field Poll director Mark DiCamillo.

The poll, taken Jan. 25 through Friday, factored in former Sen. John Edwards’ announcement Wednesday that he was leaving the Democratic contest. Many of those voters, who were called back after Edwards’ withdrawal, told the survey takers to count them as undecided, at least for now.

About 25 percent of those surveyed had cast their ballots by mail.

Those who have or intended to vote by mail are evenly divided between Obama and Clinton in the Democratic contest. Those who say they will go to the polls Tuesday narrowly favor Clinton.

McCain and Romney

McCain leads Romney by 13 percentage points among those planning to vote Tuesday, but mail-in voters favor him by just 3 percentage points.

The poll is a snapshot of two exceptionally fluid races, particularly on the Democratic side, and many events could alter the outcome. Unwilling to predict what might happen Tuesday, DiCamillo said, “It’s likely to be a close election. I’ll stick my neck out and say that.”

Polling in other Super Tuesday states also has shown the race tightening across the country. However, late polling in early state contests often didn’t mirror the final results.

In the end, the Democratic contest will hinge on who shows up to vote Tuesday. “If just slightly more women than we expect turn out for Hillary or slightly more men for Obama, it will make the difference,” DiCamillo said.

The gender gap is more defined than ever in this race. Men are moving to Obama, supporting him 44 percent to 31 percent over Clinton. Clinton still leads among women, 40 percent to 27 percent, though that’s not as big as the 2-to-1 advantage she enjoyed just six weeks ago.

Gender factor

In previous polls, women and Latinos, who vote in large proportions in the Democratic primary, have accounted for Clinton’s double-digit leads.

As in those earlier polls, Latinos still overwhelmingly support Clinton by the same margins black voters support Obama.

But Obama may have a new inroad with some women, DiCamillo said. He said 20 percent of women remain undecided compared with 14 percent of men. “Women are in greater conflict than men. Women like Obama. I think in any other election they would be supporting him in a big way,” he said. “But he’s running against Hillary Clinton, who could be the first woman president.”

Obama has picked up even broader support from subgroups of voters he already had been doing well with: the educated, the more affluent, younger voters and those living in the Bay Area. He also now has a healthy margin of support over Clinton among decline-to-state voters. However, Clinton has a 5 percentage point lead among registered Democrats.

In the Field Poll of two weeks ago, Obama had come close to matching Clinton among non-Hispanic white voters, and in this current poll Clinton and Obama are splitting that vote exactly in half.

For the first time this primary season, Obama leads Clinton among Bay Area voters, by 10 percentage points. Clinton leads in all other parts of the state, including Los Angeles County, where she is up by 8 percentage points.

For Republicans, unusual factors are brewing counter to typical GOP voting patterns, and that is helping McCain. By a lead of more than 2-to-1, McCain enjoys very strong support among moderates and those who describe themselves as moderately conservative. Romney has an advantage of 8 percentage points among strong conservatives, but other candidates, including former Arkansas Gov. Mike Huckabee and Rep. Ron Paul of Texas also siphon off some of those voters.

‘Moderate wing’

“There’s no single darling of the strong conservatives. That opens the door for the moderate wing in California, which really is historic,” in a primary, DiCamillo said. “McCain is taking advantage of that. His ‘express’ is moving down the track,” he added.

McCain leads among all age, gender and income groups. He and Huckabee are virtually tied among those who consider themselves born-again Christians, with Romney running in third.

The poll also showed that in hypothetical general-election matchups, Obama leads both McCain and Romney by slightly larger margins than does Clinton. But the margin between either Democrat and McCain has shrunk considerably since the Field Poll last measured them in December, and before McCain’s fortunes turned with a New Hampshire win.

Obama beats McCain by 7 percentage points, but Clinton only has a 2 percentage point lead.

Sen. John Kerry of Massachusetts, who appeared at a Saturday rally in San Jose on behalf of Obama, said, “What I know is we’re still behind and we have to keep working.”

He added, “We were the complete underdogs in this campaign and now we’re moving.” Now that the Obama campaign has reached California, he added, “People see in him this unifier ability.”

Clinton’s California campaign chief, Ace Smith, said he always expected the race would tighten. “We have great confidence in our organization and in our voter turnout programs. And you have to take into account that people have been voting for 26 days.”

He downplayed the effect of the poll. “People aren’t swayed by polls in a presidential race,” he said. “People make up their own minds.”