California Highway Patrol officers prepare to accompany the motorcade of President Barack to a fundraising event in Los Angeles, Wednesday, July 23, 2014, the final city in his three-day West Coast trip to Seattle, San Francisco and Los Angeles. ( (AP/AP)

– President Obama’s hectic fundraising schedule landed him in the back yard of television producer Shonda Rhimes (“Scandal,” “Grey’s Anatomy”) Wednesday night, where he hobnobbed with celebrities including Kerry Washington and joked about a “top secret” video of him dancing with Janelle Monae and Usher.

But maybe the most dazzling result of all his efforts is the degree to which he has helped restore the Democratic Party to financial health. The DNC has reduced it debt by 80 percent since the beginning of the year, largely because of Obama’s efforts.

The Democratic National Committee has spent the past few years deeply in debt, due in large part to the millions it spent getting Obama reelected in 2012. The president, now safely into his second term, has become a major factor in helping restore the Democratic party to solvency as it prepares for crucial midterm elections in the fall.

“In 2012, we went into debt to win the White House and Republicans sat on money to lose,” said DNC Chairwoman Rep. Debbie Wasserman Schultz (D-Fla.) “The president’s support to reduce that debt and eliminate it has been key.”

The DNC has raised $116 million this cycle through the end of June, whittling down its debt to $3 million. It is a far cry from the $22.5 million the party owed in March 2013. At the beginning of this year the party was mired in $15.9 million of debt, according to Federal Election Commission reports.

A sharp boost in fundraising in the past several months helped the party pay its outstanding bills. In March, the DNC raised more than $10 million, its best month of the cycle, according to FEC reports.

Since then, the committee has averaged $9 million a month in donations, compared with an average of $5.8 million a month during the same period last year.

Democrats outraised Republicans in June, but the Republican National Committee has $14.4 million in the bank, compared with the DNC’s $7.8 million.

Obama’s influence has not been the only thing that has helped the party. A number of factors have aligned to help Democrats in recent months, including a surge of small donations in March that helped power the haul — about half of the March money was raised in increments less than $200 — a reorganization of DNC staff and a bolstering of the committee’s online fundraising and direct appeals. Some of those e-mails include the signature of Obama. Vice President Biden and first lady Michelle Obama have also attended DNC fundraisers in recent months.

But it has been Obama’s events, which regularly charge tens of thousands of dollars for admission, that have helped edge the party closer to the black. Since the end of February, Obama has attended 18 DNC fundraising events, including three on his current West Coast swing through Seattle, San Francisco and Los Angeles.

“The president’s approach to helping Democratic candidates is simple: How can we help?” said White House spokesman Eric Schultz. “That support includes helping to raise resources so candidates can wage effective campaigns, providing access to our vast grass-roots network of supporters, and most importantly, helping to frame the debate voters will face.”

By the end of April, the party reduced its debt to $8.7 million; by May 31, it owed $4.9 million. Nine of the president’s 18 events took place in March, April and May.

Congress members are pitching their cities to the Democratic National Committee, all in hopes of landing the 2016 convention. (Jackie Kucinich/The Washington Post)

“The president’s support has been a key part of our effort to both retire the debt and make sure we’re moving forward,” said Amy Dacey, chief executive of the DNC.

A number of those events took place in the fundraising well that is California, including a $32,000-a-person brunch at a home in Laguna Beach with sweeping Pacific Ocean views in June and a May fundraiser in Silicon Valley co-hosted by Yahoo chief executive Marissa Mayer.

About 450 people attended the fundraiser at Rhimes’s home Wednesday evening. Tickets started at $1,000. On Thursday morning Obama attended a roundtable discussion at a Los Angeles home where 25 DNC donors paid up to $32,400 each to chat with the president.

Obama continued his tried-and-true fundraiser strategy of hammering at Republicans, a tactic Democrats said has recently riled up the base and gotten people to pull out their wallets.

“But the truth of the matter is that the reason right now we don’t have a government that’s working for the American people is because the Republican Party has been taken over by people who just don’t believe in government,” Obama said at Rhimes’s fundraiser, “people who think that the existing arrangements where just a few folks who are doing well, and companies that pollute should be able to pollute, and companies that want to cheat you on your credit card should be able to do that, and that anything goes — that’s their philosophy.”

Officials at the DNC and Democratic Congressional Campaign Committee — which currently has no debt — said that recent events, including House Speaker John A. Boehner’s (R-Ohio) announcement in June that he would file a lawsuit against Obama and last year’s government shutdown, have also been a boon to fundraising. Any time Obama shows up, people will pay to listen.

“He’s absolutely pivotal to our fundraising success,” Rep. Steve Israel (D-N.Y.), chairman of the DCCC, said of Obama.

DNC officials said they are continuing to pay down the debt while simultaneously investing in staff, infrastructure and technology as the midterms quickly approach. Having Obama out fundraising and increasing his attacks against Republicans serves the party two purposes: filling its coffers and reminding Democratic voters that the party is trying to hang onto control of the Senate and keep seats in the House, things that no one wants more than Obama.

Obama has also helped the DNC and the other committees by sharing data his campaign collected on supporters, which allows them to build grass-roots coalitions in key states. But one Obama legacy may have hampered the DNC: Organizing for Action, the group that formed out of Obama’s reelection campaign.

“They’re competing for a lot of the same donors. That’s just the reality,” said Michael Toner, former chairman of the FEC.

DNC officials say that there is plenty of donor money to go around, and resources are not limited. But Organizing for Action owns the @barackobama Twitter account, a direct line to the president that the DNC does not possess.

For now, the party is continuing to spend much of what it takes in each month, according to FEC filings, to pay down the debt, ready for the midterms and make long-term staff and infrastructure investments. But with just over three months until the midterms, it is unusual that a party still owes money.

“I cannot recall a national political party, when that party controlled the White House, being in debt this late in a midterm election or any election season, ever,” Toner said.

Wasserman Schultz said when she agreed to stay on as chair it was critical that the party “exist not just to pay debt” and focus over the long term on a solid base for 2016 and 2020.

“We’re really the infrastructure and the backbone of the whole party,” she said. “The stuff we fund is expensive, and we need to make sure we’re investing the whole way through.”

Matea Gold in Washington contributed to this report.