Sen. Barack Obama raised at least $25 million for his presidential campaign in the first quarter of the year, nearly matching Sen. Hillary Rodham Clinton's record-setting total and making it all but certain that Democrats will face a costly and protracted battle for their party's nomination.

Collectively, the Democratic candidates raised nearly $80 million in the first quarter, outpacing the Republican field for the first time since the Federal Election Commission began closely tracking such figures in the 1970s. Republicans took in just over $50 million in that same time frame, suggesting that a restive electorate and creative Internet strategies have fundamentally shifted the fundraising landscape for both parties.

The Illinois Democrat's unexpectedly strong fundraising performance undercuts a principal argument of Clinton's candidacy: that her ability to raise vastly more than her opponents makes her nomination inevitable. The neck-and-neck financial showings also drew fresh attention to the $37 million that Clinton spent on her easy reelection victory in New York last year, money that could have been rolled into her presidential account. Clinton ended up transferring $10 million from the Senate fund to her White House bid.

Alan Solomont, a Boston philanthropist who oversaw fundraising for Obama in the Northeast, said his candidate's fundraising performance was the result of an "almost spontaneous outpouring" from donors.

"I'm proud to tell you that, after the first quarter of the campaign, we've exceeded all of our hopes and expectations," Obama said in an e-mail to supporters yesterday, adding that the total is a "measure of just how hungry people are to turn the page on this era of small and destructive politics and repair our American community."

Obama surpassed Clinton in several areas that could be critical to their competition: He reported donations from 100,000 individuals, double the 50,000 people who gave to the former first lady. More than half of those donors, largely giving in small increments, sent money over the Internet. He raised $6.9 million online, compared with Clinton's $4.2 million. The fact that many Obama donors contributed relatively small amounts also means that he will be able to appeal to those donors for contributions later in the campaign.

Of Obama's overall receipts, $23.5 million can be used in the primary contests. Clinton officials have refused to disclose how much of her cash will be available under campaign finance rules for the primaries -- rather than designated for the general election and unusable unless she wins the nomination.

Still, Clinton officials maintained an upbeat tone after Obama's figures were released, saying that being tested could end up serving their candidate well. "Hillary has raised more money than any candidate running for president ever in the first quarter," Terence R. McAuliffe, chairman of Hillary for President, said in an interview yesterday.

"She's won the first primary -- the money primary -- and now people are going to focus right back on all the issues," McAuliffe said. "We're in a great position. This is going to be a long, drawn-out primary. We're going to have to earn this nomination."

After letting anticipation about his totals build for several days, Obama's campaign released his figures in a brief news release and did not authorize his fundraising officials to grant interviews. Obama had avoided questions from reporters leading up to the announcement, apparently in the hope of appearing low-key about the financial aspect of a race in which he has promised to run a "different kind of campaign," and to let the numbers speak for themselves.

Campaigning in New Hampshire on Tuesday, he even expressed distaste for the fundraising grind. Challenged by a voter to explain whether he would be beholden to his donors, Obama said that he had "always tried to curb the influence of money in politics," starting with an ethics bill in the Illinois legislature, but that he could not compete for president without joining the fundraising game.

"The people who are doing work in Washington cannot finance my campaign," Obama said, noting that he had banned gifts from lobbyists. "Listen, I would love not to have to raise money so I could spend all my time in town hall meetings."

Although Obama has essentially built his campaign operation from scratch over the past few months, advisers to rivals point out that he has hired skilled fundraising veterans, such as national finance director Julianna Smoot, and has not simply allowed an organic, grass-roots movement to take shape around him.

Still, the data suggested that Obama's strategy of holding low-dollar events in addition to seven-figure galas has succeeded, at least for now. He held numerous events that cost $25 or $100 per ticket, in an effort to bring in younger, first-time donors who could be tapped for future donations because they had not yet reached the $2,300 limit for contributions to an individual candidate in the primaries.

Other crucial ingredients to his success were the huge rallies, some of which drew thousands of people, and a significant Internet presence, said Mark Gorenberg, a Silicon Valley venture capitalist on Obama's national finance team.

"Those rallies drove huge interest from the community, and these people went right home to their computers to donate," Gorenberg said. "These, for the most part, were people who had never been involved before."

Financier Orin Kramer, who helped oversee the senator's New York fundraising, said that once Obama's campaign became a destination for people fed up with the political process, the calculation was simple: "The population of people previously cynical about politics exceeds the population of those who aren't. If you tap into that population, you're going to get a result like this."

Clinton, with the help of her husband, former president Bill Clinton, raised about $10 million at large events at the end of the quarter. Clinton and Obama have not specified how much cash they will have remaining to spend when the full financial reports are submitted to the FEC on April 15. Former senator John Edwards (N.C.) raised about $15 million in the first quarter, double his total from four years earlier. But advisers to Clinton said they expect the cash-on-hand number to be impressive.

The combined totals represented a paradigm shift: In 1987 and 1999, the last two campaigns in which both parties had competitive presidential primaries, Republicans held a healthy fundraising edge at this stage, according to FEC records. This time, Democrats are ahead by about $30 million.

"That's a very unusual imbalance," said Michael Toner, a former FEC chairman.

"I think it bodes well for our prospects," Democratic strategist Steve Elmendorf said. "Donors are the leading edge of the opinion elite, and I think voters are going to follow."

The imbalance also points to a digital divide that separates the two parties, according to Joe Trippi, who served as Howard Dean's campaign manager four years ago. No numbers are available for GOP online fundraising, but Trippi said a concerted effort to build an online infrastructure by Democrats means Republican numbers will not approach the more than $15 million raised by Democrats over the Internet.

"We built it and they didn't," Trippi said of the Democrats. "Now it's paying big dividends."