John F. Kerry is likely to donate a substantial portion of his excess presidential campaign cash to help elect Democratic candidates, advisers said yesterday.

Party leaders, including some of Kerry's top campaign aides, said this week that they were surprised and angry to learn that he had more than $15 million left in accounts from the Democratic primaries. They demanded to know why it was not spent to defeat President Bush or to help congressional candidates.

There were no easy answers to those questions, officials close to Kerry acknowledged yesterday, but they sought to assure Democrats that the four-term Massachusetts senator was sharing his political wealth. They said that he donated $40.5 million to Democratic causes in 2004, including $3 million each to the party's House and Senate campaign committees. More than $32 million went to the Democratic National Committee, including $9 million intended for state parties.

DNC spokesman Jano Cabrera said that was the largest contribution the DNC has ever received, and the first from a presidential primary campaign. "With this donation, the campaign more than fulfilled its commitment to our general election plan," he said.

But the DNC statement did little to mask the acrimony over the money. Some members of Kerry's campaign said the cash should have been spent to build political organizations in Ohio and Florida or to court Hispanic and black voters.

One member of Kerry's inner circle said the failure to spend the money cost Kerry victory in a close election. Another said the fact that Kerry had $45 million in the primary campaign account in mid-October raises questions about why he did not opt out of the campaign finance system for the general election to avoid spending limits.

Although some officials pointed fingers at campaign manager Mary Beth Cahill, others said Kerry knew there was a big surplus in his primary campaign account. They said he wanted to save it in the event of a recount, legal challenges or other unforeseen expenses. In the end, they said, Kerry's nest egg will be less than $10 million.