The allegations are a major embarrassment for the regulator meant to restore confidence in the audit industry.

The U.S. regulator overseeing auditors was rocked by criminal charges as federal prosecutors accused three former employees of leaking inside information to KPMG so it could improve its audit results.

The allegations are a major embarrassment for the Public Company Accounting Oversight Board, a regulator that was meant to restore public confidence in the audit industry after accounting scandals at Enron and WorldCom cost investors billions of dollars. Claims that employees shared confidential information with a top audit firm raise doubt about whether the PCAOB is up to the job.

They’re also another black eye for KPMG, one of the Big Four accounting firms. The company paid $456 million in 2006 to avoid criminal charges that it helped wealthy clients dodge $2.5 billion in taxes. The firm is now accused of poaching PCAOB officials and using their contacts to get warnings about pending inspections.

Three former employees of PCAOB, who went on to work for KPMG or were seeking employment there, stole the information tied to future exams, the Justice Department and Securities and Exchange Commission said Monday. The former PCAOB employees – Brian Sweet, Cynthia Holder and Jeffrey Wada – made unauthorized disclosures of PCAOB plans for inspections of KPMG audits from 2015 until February 2017, according to the government.

“These accountants engaged in shocking misconduct – literally stealing the exam – in an effort to interfere with the PCAOB’s ability to detect audit deficiencies,” said Steven Peikin, co-head of the SEC’s enforcement division.

Also charged were three KPMG employees: David Middendorf, then-national managing partner for audit quality, Thomas Whittle, partner-in-charge for inspections and David Britt, banking and capital markets group co-leader.

Britt was targeted unfairly by the government, his attorney Melinda Haag, said in a statement.

“The allegations in this indictment against David involve conduct that is simply not a crime,” Haag said. “We look forward to proving his innocence in court.”

KPMG was trying to improve on the poor grades it received from PCAOB in 2013 and 2014, the U.S. said. In 2014, for example, KPMG got about 28 comments in connection with 51 audits inspected by the PCAOB. That was about twice as many comments as the average of its competitors, the government said. Inspection results are an important metric in attracting new clients, the U.S. said.

The accounting firm made hiring Sweet a “top priority” since he worked on a team that inspected its work. On his last day, Sweet copied confidential information, including a list of accounting firm audits the PCAOB would inspect in 2015, to a personal hard drive, according to the government.

The government described the scheme in a filing in Manhattan federal court.

According to that filing, on his first day on the job, Sweet had lunch with his new boss, Whittle, and other colleagues, where he disclosed that a particular client audit would be examined by the PCAOB. Several days later, Sweet emailed the list of KPMG audit clients that would be reviewed to Whittle, who then forwarded it to his boss Middendorf, writing: “The complete list. Obviously, very sensitive. We will not be broadcasting this.”

Sweet was asked who else KPMG should hire and he recommended Holder, who joined a few months later in 2015.

Wada, the third PCAOB employee, was also looking to join. After being passed over for a promotion in March 2016, Wada, who said he was “screwed” by the episode, started divulging confidential details to Holder. Wada was also looking to work for KPMG, sending his resume to Holder, writing “I am now trying to sell myself to KPMG” in January 2017 .

The next month, he texted Holder that he had the full list of audits the PCAOB would examine, “OK, I have the grocery list” adding later “All the things you’ll need for the year.”

KPMG promptly notified authorities when it first discovered the issue early last year and has been fully cooperating with the government, spokesman Manuel Gonclaves said in a statement.

“KPMG took swift and decisive action, including the engagement of outside legal counsel to conduct a detailed investigation and the separation of involved individuals from the firm,” Gonclaves said. “Since then, KPMG has taken remedial actions to assure that such conduct cannot happen again.”

The PCAOB said it also cooperated with the investigators and when it learned of the alleged misconduct its board and staff reviewed and reinforced the safeguards against improper disclosure of confidential information.

“The new PCAOB Board will conduct an ongoing review of the organization’s information technology and security controls, as well as its compliance and ethics protocols, to assess their effectiveness,” PCAOB Chairman William Duhnke said in a statement.

The PCAOB was created by Congress under the 2002 Sarbanes-Oxley Act. Its inspections, which are central to this case, are at the heart of its mission as they are the main check on whether accounting firms are doing quality audits of public companies.

In the 2005 prosecution over fraudulent tax shelters, 17 former KPMG executives were charged, but a judge ruled that the government violated their right to counsel by pressuring the firm to withhold legal fees and threw most of the charges out.