The Democratic National Committee and the presidential campaign of Bernie Sanders have reached an agreement to restore the campaign's access to the DNC's massive voter file.

The decision, announced just after midnight Saturday, capped off a chaotic day in which the DNC blocked the Sanders campaign from accessing the national database, which plays a critical role in campaigns' strategies and daily operations.

The party took that step after it discovered that staffers for the Vermont senator had accessed and saved data collected by rival Hillary Clinton's campaign, made briefly accessible due to a software glitch.

In response to the harsh rebuke, the Sanders campaign charged Friday morning that the DNC was "actively attempting to undermine our campaign" in favor of Clinton. The campaign filed a lawsuit in federal court that evening to stop the DNC from blocking access to the data, saying they stood to lose $600,000 in donations per day without access to the data, which is critical to identifying and contacting voters.

According to Sanders campaign manager Jeff Weaver, the agreement was reached before a hearing on the emergency injunction.

"We are extremely pleased that the DNC has reversed its outrageous decision to take Sen. Sanders' data. The information we provided tonight is essentially the same information we already sent them by email on Thursday," Weaver said in a statement.

"Clearly, they were very concerned about their prospects in court. Now what we need to restore confidence in the DNC's ability to secure data is an independent audit that encompasses the DNC's record this entire campaign. Transparency at the DNC is essential. We trust they have nothing to hide," he continued.

But a DNC statement told a different side of the story, saying that the committee restored access only after the Sanders campaign provided more information to them about the breach.

"The Sanders campaign has now complied with the DNC's request to provide the information that we have requested of them. Based on this information, we are restoring the Sanders campaign's access to the voter file, but will continue to investigate to ensure that the data that was inappropriately accessed has been deleted and is no longer in possession of the Sanders campaign," DNC Chairwoman Debbie Wasserman Schultz said in a statement.

"The Sanders campaign has agreed to fully cooperate with the continuing DNC investigation of this breach. The fact that data was accessed inappropriately is completely unacceptable, and the DNC expects each campaign to operate with integrity going forward with respect to the voter file," she continued.

According to the Sanders campaign, access to the voter information should be restored by Saturday morning. The massive database is one that all candidates, from the federal down to the local level, have access to in order to build contact lists, voter models and more. Candidates then add their own information about voters, but that proprietary information is supposed to be blocked from other candidates.

The Clinton campaign issued a stinging response Friday evening in response to the news that the Sanders campaign had accessed their data. In a conference call with reporters, Clinton campaign manager Robby Mook said their rival's actions were "totally unacceptable."

"This was a very egregious breach and our data was stolen," Mook said. "We need to be sure that the Sanders campaign no longer has access to our data."

The Clinton campaign said in a statement after the DNC's decision early Saturday they were "pleased" that the Sanders campaign was cooperating with the DNC.

"We are pleased that the Sanders campaign has agreed to submit to an independent audit to determine the full extent of the intrusion its staff carried out earlier this week, and also to ensure that Sanders' voter file no longer contains any of the proprietary data that was taken from us," Clinton spokesman Brian Fallon said. "We believe this audit should proceed immediately, and, pending its findings, we expect further disciplinary action to be taken as appropriate."

The Sanders campaign had originally said that one staffer accessed the data and that he had since been let go. But according to audit documents obtained and reviewed by NPR, at least four people accessed the data 24 times during the window it was unprotected and saved it to their own folders. Data breached included information on specific voters in the early states of Iowa, New Hampshire and South Carolina.

Copyright 2016 NPR. To see more, visit