Washington (CNN) Former Democratic National Committee interim chair Donna Brazile, in newly released excerpts of her forthcoming book, alleges that an unethical agreement was signed between Hillary Clinton's 2016 presidential campaign and the DNC to keep the party financially afloat.

Bernie Sanders' 2016 campaign also signed its own joint fundraising agreement with the DNC.

In excerpts from "Hacks: The Inside Story of the Break-ins and Breakdowns that Put Donald Trump in the White House," published in Politico , Brazile writes the DNC was rigged in Clinton's favor because her campaign was largely financing the party early on in the presidential election.

Brazile's comments rip a scab off a wound that plagued the Democratic Party during last year's primary and charge the Clinton campaign with impropriety.

The Democratic strategist said the agreement "was not illegal, but it sure looked unethical."

"If the fight had been fair, one campaign would not have control of the party before the voters had decided which one they wanted to lead. This was not a criminal act, but as I saw it, it compromised the party's integrity," Brazile added.

President Donald Trump accused Democrats of "real collusion" in two tweets on the matter Thursday night, calling the revelations a "major violation of campaign finance laws and money laundering."

"Donna Brazile just stated the DNC RIGGED the system to illegally steal the Primary from Bernie Sanders. Bought and paid for by Crooked H...." he wrote.

Trump then followed up with a second tweet: "....This is real collusion and dishonesty. Major violation of Campaign Finance Laws and Money Laundering - where is our Justice Department?"

Donna Brazile just stated the DNC RIGGED the system to illegally steal the Primary from Bernie Sanders. Bought and paid for by Crooked H.... — Donald J. Trump (@realDonaldTrump) November 3, 2017

....This is real collusion and dishonesty. Major violation of Campaign Finance Laws and Money Laundering - where is our Justice Department? — Donald J. Trump (@realDonaldTrump) November 3, 2017

Politico had reported in August 2015 about the joint fundraising effort, but Brazile's book suggests its scope -- and Clinton's influence over it -- went beyond what was previously known to the public.

The joint fundraising agreements, according to multiple senior Democratic sources with knowledge of the agreements, were a lifeline to a DNC deep in debt.

President Barack Obama had left the party with millions in debt after the 2012 election and was paying the money off far too slowly for most Democrats. To fight this problem, former chairwoman Debbie Wasserman Schultz began taking on costly loans and by the time she approached the Clinton and Sanders campaigns -- around Labor Day 2015 -- the DNC was nearing the end of their credit rope, a source said.

As CNN reported in May 2016, both Democratic campaigns signed joint fundraising efforts with the Democratic National Committee, allowing the presidential campaigns to raise money for the Democratic committee and a host of state Democratic parties for use in the general election. The agreements, sources told CNN at the time, were the same as the ones Obama's successful 2008 and 2012 campaigns used.

Clinton, though, was the only candidate to use the agreement, raising by May 2016 close to $50 million for the DNC and state parties through the Hillary Victory Fund.

Weaver: DNC actions 'egregious, undemocratic'

Sanders' former campaign chair Jeffrey Weaver said Thursday in an interview with CNN's Brooke Baldwin that the campaign had not initially known the "full scope" of the deal between the Clinton campaign and the DNC, but that the Sanders campaign did see several instances where the DNC seemed to tip the scale toward Clinton, as evidenced by Sanders' many complaints about the party organization through the primary season.

"The behavior the DNC engaged in was egregious, undemocratic and it can't be allowed to happen again," Weaver said.

Weaver said, however, that the lessons of 2016 should be taken to reform the party's approach to the grassroots and behavior during primary seasons.

"Let me tell this to the elites who today still control much of the Democratic Party apparatus: If you do not open up the party, if you do not allow the people in, if you do not advocate for the types of reforms that we need, you will be destroying the opportunity we have to take on Donald Trump," Weaver said.

He also asserted that he believed Sanders could have won the general election.

"There is no doubt that he would have defeated Donald Trump," Weaver said.

Clinton, through a spokesperson, declined to comment.

Wasserman Schultz, in a statement, said she is proud of her work at the DNC.

"It was a tremendous honor to be asked by President (Barack) Obama to serve as chair of the DNC. I am proud of the work our team did to support Democrats up and down the ballot in the 2016 election and to re-elect the president in 2012," Wasserman Schultz said. "With Donald Trump in the White House, Democrats must stay focused on enacting a progressive agenda to protect our citizens, our values and our democracy and remain united towards our goal of electing Democratic congressional majorities in 2018."

Joint fundraising agreement

Brazile resigned from her role as a CNN contributor in October 2016 after WikiLeaks released an email in which she says she got advance questions before a town hall event. She then sent questions to Clinton's campaign in advance of a CNN debate and a town hall.

Xochitl Hinojosa, the DNC's communications director, said in response to Brazile's allegations that "the DNC must remain neutral in the presidential primary process, and there shouldn't even be a perception that the DNC is interfering in that process."

"Joint fundraising committees were created between the DNC and both Hillary Clinton and Bernie Sanders in attempt to raise the general election funds needed to win in 2016," she said. "Clinton was the only candidate who raised money for the party through her joint fundraising committee with the DNC, which would benefit any candidate coming out of the presidential primary process.

Hinojosa added that under new DNC chair Tom Perez, the committee and state parties have dispensed with the old fundraising agreement and signed a new agreement with state Democratic organizations.

Brazile's primary argument is that the Clinton campaign, through its joint fundraising agreement with the DNC, gave Clinton control of the "party's finances, strategy, and all the money raised."

"Her campaign had the right of refusal of who would be the party communications director, and it would make final decisions on all the other staff," Brazile wrote.

A source confirmed that Clinton's campaign did stipulate rules to the DNC for the fundraising help. It agreed to provide the DNC with money each month to pay for overhead. A concern was that Wasserman Schultz would take the money from the joint fundraising agreement and begin quickly spending it, so they limited how much the DNC could spend.

"Hillary for America (the campaign) and the Hillary Victory Fund (its joint fundraising vehicle with the DNC) had taken care of 80% of the remaining debt in 2016, about $10 million, and had placed the party on an allowance," Brazile wrote.

As Politico reported , Brazile notes that while Clinton claimed support for the DNC meant supporting state parties, state parties kept less than half of 1% of the $82 million raised by Clinton's campaign fundraisers.

The idea for the joint fundraising agreements at the time was to create a a bank of money for the DNC that could then be spent during the general election, whether the nominee was Clinton or Sanders.

Politically, though, that didn't work for Sanders, who charged the Clinton campaign in May 2016 with duping the state parties.

"Secretary Clinton is looting funds meant for the state parties to skirt fundraising limits on her presidential campaign," Jeff Weaver, Sanders' campaign manager, said in a statement at the time. "We think the Clinton campaign should let the state parties keep their fair share of the cash."

Sanders had the option to raise money for the DNC and state parties but decided not to do it because it would have been politically difficult for the candidate to slam the DNC in public while raising money for them in private. Sanders had largely eschewed fundraisers, too.

Brazile, in the new book, placed blame for the DNC's issues on poor management by Wasserman Schultz, a Florida Democrat.

She wrote that Wasserman Schultz didn't make cuts to DNC staff following the previous election cycle and that led to a ballooning budget double what Brazile had seen as interim chair five years earlier. Gary Gensler, the chief financial officer of Clinton's campaign, allegedly told her the party needed $3.5 million to $4 million to conduct operations each month.

"Debbie was not a good manager," Brazile wrote. "She hadn't been very interested in controlling the party -- she let Clinton's headquarters in Brooklyn do as it desired so she didn't have to inform the party officers how bad the situation was."

DNC fundraiser fired

The DNC's troubles have continued in the months since Trump took office.

Particularly worrisome to Democrats: The party had raised just $51 million in the calendar year through September, compared to the Republican National Committee's $104 million.

On Thursday, the DNC fired its finance director, Emily Mellencamp Smith, whose hiring was just announced in June as part of new chairman Perez's efforts to rebuild the party.

"We are grateful for Emily Mellencamp Smith's work to help build a fundraising team that will raise the funds to win in 2017, 2018 and beyond. Emily is going back to consulting and helping elect Democrats in upcoming races, including staying on in a consulting role for the DNC at this time," DNC press secretary Michael Tyler said.