The Chinese affiliates of the Big Four accounting firms should be barred for six months from auditing companies that are publicly traded in the United States, a Securities and Exchange ­Commission administrative-law judge ruled Wednesday.

The decision stems from an SEC enforcement action, brought in 2012, that accused the affiliaties of violating the law when they refused to turn over auditing documents of nine China-based firms that the agency was investigating for potential misconduct.

In a strongly worded decision, Judge Cameron Elliot said the affiliates should be sanctioned for “willfully violating” the law, “flouting” the agency’s regulatory authority and failing to “recognize the wrongful nature of their conduct.”

The case has been closely watched in part because of the fallout it may have on multinational companies that do business in China. The concern was that these companies would be hard-pressed to find new auditors there.

The affiliates — Deloitte ­Touche Tohmatsu, Ernst & Young Hua Ming, KPMG Huazhen and Pricewaterhouse Coopers Zhong Tian — said Wednesday that they plan to appeal the decision. In a joint statement, they called the ruling “regrettable,” adding that U.S. and Chinese regulators have increasingly shared information in the past year. They also said the legal battle would not interrupt their service to their clients.

“What a stunning decision,” said Lynn E. Turner, former chief accountant at the SEC and now a managing director at the economic consulting firm LitiNomics. “This type of suspension among the Big Four happens only once every 10 to 20 years.”

Tensions have been building for years around this issue, as accounting scandals erupted at China-based companies that are traded on U.S. exchanges. As the number of incidents kept climbing, regulators raised concern about whether the firms that audit these companies have been doing their jobs properly.

In December 2012, the SEC went after the Big Four’s Chinese affiliates and the Chinese unit of another big accounting firm, BDO, accusing them of violating the 2002 Sarbanes-Oxley accounting-reform law. The BDO unit, which is no longer affiliated with BDO, was publicly reprimanded by the court, as were the other firms. But BDO was not suspended because its infraction was an isolated one, the court said.

Sarbanes-Oxley requires auditors to grant the SEC access to “work papers” if the agency asks for them. The papers detail an auditor’s work on behalf of clients and documents the evidence that the clients provide to back up their representations of a company’s financial health.

The SEC said it was gratified by Wednesday’s court decision. “These records are critical to our ability to investigate potential securities law violations and protect investors,” Matthew Solomon, the SEC’s chief litigation counsel, said in a statement.

The auditing firms argued that producing the documents for U.S. regulators would violate Chinese law and expose their employees to jail time. Some of the firms have said that conflicts between U.S. and Chinese laws need to be resolved diplomatically.

They had told the judge that if the court ruled against them, it would leave clients that operate in China in a lurch. They said that those firms would not be able to find other adequate auditors and that the investors would suffer — an argument that the court rejected.

“In this case the need to protect future investors outweighs the need to protect current investors,” Elliot wrote in his decision.

The court barred the auditing firms from signing audit reports and from doing more than 50 percent of the audit work in a company — even if they are not signing off on a report.

The SEC has not disclosed the name of the nine companies it was initially investigating, or whether it continues to investigate them. But the court documents revealed the nature of the businesses involved. The companies included a biodiesel producer, a chemical manufacturer and a firm that distributes solar panels.