The Democratic Party and the Bernie Sanders campaign came to an agreement late Friday to restore the campaign’s access to the party’s voter database.

The Sanders campaign filed a lawsuit in federal court earlier Friday seeking to regain access to the data after Sanders’ staff was accused of spying on Hillary Clinton’s campaign files. The lawsuit claimed the campaign was “sustaining irreparable injury and financial losses” over the temporary suspension.

The Washington Post first reported Thursday that the Sanders camp acknowledged a low-level staffer viewed Clinton campaign voter data and was fired as a result. The DNC then blocked the Sanders campaign access to the party’s master list of likely Democratic voters until it provided a full explanation.

The reaction to the data breach opened up an ugly fault line between the two campaigns that had so far engaged in a civil White House campaign. The incident also increased Sanders and his voters’ suspicions that the DNC is unfairly working to support Clinton’s run for president.

"Clearly, in this case, they are trying to help the Clinton campaign," Sanders campaign manager Jeff Weaver said of the Democratic National Committee.

Weaver accused party leadership of unfairly locking down information the campaign itself obtained. He said that if the DNC continued to “hold our data hostage,” they will bring the party to court.

The DNC rents out the master list in question to national and state campaigns, which add their own information compiled by volunteers and field workers.

DNC Chairwoman Debbie Wasserman Schultz said that on Wednesday the Sanders campaign "inappropriately and systematically" accessed Clinton's data. She rejected Weaver's effort to blame the breach on a software glitch and the actions of a small group of rogue staffers, one of whom was fired.

In response, the DNC temporarily turned off Sanders' access to the database and asked for an accounting of how the information was used and disposed of.

That decision infuriated Weaver, who said the party had cut Sanders' team off from the "lifeblood of any campaign." He added, "It is our information, not the DNC's."

Hours later, the Sanders camp filed a lawsuit in U.S. District Court in Washington seeking an immediate restoration of access to the database. Without it, the lawsuit said, the campaign would lose approximately $600,000 in donations a day.

"It's outrageous to suggest that our campaign 'stole' any data," said Sanders spokesman Michael Briggs. "What is true is the data we collected and need to run a winning campaign is now being stolen from us by a DNC dominated by Clinton people."

Late Friday and just hours from a Democratic national debate, the Sanders camp had complied with the party’s information request.

"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," Wasserman Schultz said in a statement.

The Clinton campaign said in a statement early Saturday it was pleased to see the Sanders camp agreed to submit an independent review.

"We believe this audit should proceed immediately, and, pending its findings, we expect further disciplinary action to be taken as appropriate,” the statement said.

Sanders spokesman Michael Briggs placed the blame for the incident in large part on the software vendor, NGP VAN.

“Sadly, the vendor who runs the DNC's voter file program continues to make serious errors. On more than one occasion, the vendor has dropped the firewall between the data of different Democratic campaigns,” he said in a statement to Fox News Friday. While saying it was “unacceptable” for a campaign staffer to access “some modeling data from another campaign,” he also said they want to work with the DNC and vendor to fix the “software flaws” that could make Sanders’ records vulnerable as well.

Another campaign official told the Post that the Clinton data was never downloaded or printed.

But the plot thickened as The Associated Press reported that, according to an unnamed source, a summary of computer logs showed four aides to Sanders' presidential campaign – not just one -- accessed voter data compiled by the Clinton campaign.

Meanwhile, Stu Trevelyan, the NGP VAN’s CEO, told the Post the breach was an "isolated incident that was fairly short in duration ... By lunchtime, it was resolved."

“We were informed that our proprietary data was breached by Sanders campaign staff in 25 searches by four different accounts and that this data was saved into the Sanders' campaign account," Hillary for America National Press Secretary Brian Fallon said in a statement Friday.

NGP VAN said the Sanders staff involved were able to "search by and view (but not export or save or act on) some attributes that came from another campaign." The company said the Sanders campaign saved a "one page-style report containing summary data."

Weaver argued the firewall used by the vendor had previously failed, and he railed against the party for not taking the steps required to keep the information secure. He said in an interview with CNN late Friday that "we don't have any Clinton data."

Josh Uretsky, the data director fired by Sanders' campaign, said his team was merely investigating the security problem and trying to figure out how exposed the software patch left their own data.

"I believe that I took appropriate steps to audit and assess the security breach and that nothing I did was done in a way that it would give the Sanders campaign a competitive advantage," Uretsky said in an email to The Associated Press.

Fox News' Whitney Ksiazek and Mike Emanuel and the Associated Press contributed to this report.