With an eye on both its reputation and its wallet, Covington & Burling has spent two years fighting a judge’s ruling that the firm betrayed a former client, 3M Company, by suing it on behalf of the Minnesota attorney general. On Wednesday, Minnesota’s highest court agreed with Covington that the judge went too far, but it stopped short of absolving the firm for its actions.

The Minnesota Supreme Court partially reversed a decision that disqualified Covington from pursuing an environmental case against 3M, writing that the lower court “did not consider legally relevant factors in conducting its disqualification analysis.” After reviving some of Covington’s failed defenses, the appeals court remanded for a do-over disqualification hearing.