King & Spalding, the law firm that agreed to defend the constitutionality of the Defense of Marriage Act (PDF), withdrew from the case on Monday. House Republicans are furious, and some legal ethicists are concerned that it will undermine people’s trust that their lawyer will stick with them. Can your lawyer just drop you?

Under certain circumstances. Generally speaking, the states’ rules of professional conduct permit an attorney to dump a client if the breakup won’t hurt him, such at the very beginning of the case, or if there’s a suitable replacement waiting in the wings. (That’s the rationale King & Spalding have used to withdraw from the Defense of Marriage Act case.) However, abandonment may be acceptable even if it harms the client’s interests, especially if the client has done something wrong. For example, a lawyer can walk away if the client is engaged in a continuing criminal enterprise, if he’s using the lawyer to perpetuate his illegal scheme, or if the client asks the lawyer to do something illegal himself. Deadbeat clients also risk abandonment, as do those who refuse to cooperate in their own representation. If the case has already been filed with a court, the lawyer usually needs the judge’s blessing to bow out. In non-litigation matters, no special permission is required.

Withdrawal from representation is a surprisingly lively area of legal ethics. Consider the classic case of the avowed perjurer. Criminal defendants have a constitutional right to take the stand in their own defense. Occasionally, one of them tells his lawyer in advance that his entire line of testimony will be lies. This scenario presents what legal scholar Monroe Freedman famously referred to as the lawyer’s “trilemma.” The attorney has an obligation to fight for the client’s interests, a responsibility to identify perjury to the court, and a duty to keep his client’s secrets. Because the client has put the attorney in a situation in which it’s impossible to fulfill all three professional obligations, some lawyers see this as a situation that demands withdrawal.

Unfortunately, it’s not that easy. As mentioned above, an attorney can’t withdraw in the middle of litigation without the judge’s permission, and it’s indisputably unethical for an advocate to directly inform the judge that his client is a liar. What usually happens in these cases is that the lawyer approaches the bench and asks to beg off the case for vague “ethical reasons.” The judge, knowing exactly what’s going on, typically denies the request, because the jury would smell a rat if the lawyer were to disappear right before the defendant took the stand. The judge, continuing the Kabuki-style exchange, informs the advocate that he has satisfied his ethical obligations and must continue. In some courts, the lawyer can protect his sense of ethics by simply putting the client on the stand and instructing him to “tell the jury his story,” rather than specifically prompting the lies.

There’s also the controversial issue of “noisy withdrawal.” Sometimes, in the course of a representation, an attorney finds out that his client has been using him as a pawn in a criminal scheme. In such cases, some legal ethicists think it’s not enough to withdraw—the lawyer must also publicly disavow his prior actions in representing the client. Government regulators have supported such moves, but they raise serious concerns about confidentiality and the fiduciary duty that lawyers have to their clients—even the bad ones. A noisy withdrawal is tantamount to turning the client in.

Got a question about today’s news? Ask the Explainer.

Explainer thanks Stephen Gillers of New York University School of Law and Thomas D. Morgan of the George Washington University Law School.