Hillary Rodham Clinton burned through nearly all of the money she raised during the last three months while raising far less than she did previously, according to fund-raising figures released by her campaign on Thursday, and she enters the fall campaign with a substantially smaller cash advantage over her closest rival, Senator Bernie Sanders of Vermont.

Mrs. Clinton, a Democrat who has been able to tap into one of the most successful fund-raising networks in American politics, reported raising more than $28 million for her primary campaign since the beginning of July, and spent about 90 percent of it, ending with $32 million on hand.

But during a summer when insurgent candidates in both parties rose to the forefront of the campaign, Mr. Sanders, a socialist who has held just a handful of formal fund-raisers, brought in more than $26 million and began October with about the same amount of cash on hand, according to his campaign.

Ben Carson, a Republican and retired neurosurgeon who has emerged as a favorite of religious conservatives in states like Iowa and South Carolina, raised $20 million from 353,000 donors, according to his aides. Like Mr. Sanders, he increased the pace of his fund-raising from the spring, but he ended with far less money in the bank, about $12 million.