U.S. District Judge Lewis Kaplan wrote he saw no option other than dismissing the charges because prosecutors had violated the defendants' constitutional rights by pressuring KPMG to stop paying their legal fees.
"The court has reached this conclusion only after pursuing every alternative short of dismissal and only with the greatest reluctance," the judge wrote in a 64-page opinion.
Charges against ex-KPMG tax partner Robert Pfaff, ex-KPMG senior tax manager John Larson and ex-KPMG tax partner David Greenberg still stand because the employees hadn't proved KPMG would have paid their defense costs, even if the government had left the company alone on that matter, the judge ruled.
Kaplan also let the case proceed against a lawyer and an investment adviser who weren't employed by KPMG and whose rights weren't affected.
The government had alleged 16 former KPMG executives and the two others with scheming to let wealthy people avoid paying billions of dollars in taxes to the U.S. Internal Revenue Service.
Five defendants have pleaded guilty to criminal charges.
The case against the remaining defendants is scheduled for trial in September.