WASHINGTON — The law firm hired by Republicans in the House of Representatives to defend the constitutionality of the Defense of Marriage Act withdrew Monday amid pressure from gay-rights groups. The decision prompted the resignation of a prominent partner, who said he intended to take the case with him to another law office.

Gay rights groups criticized the 126-year-old, Atlanta-based law firm, King & Spalding, saying that its agreement to defend the law, which prohibits federal recognition of gay marriages, would hurt its ability to recruit and retain lawyers. The firm’s chairman, Robert Hays, said Monday that the firm would no longer defend the law.

“I determined that the process used for vetting this engagement was inadequate,” he said.

“Ultimately I am responsible for any mistakes that occurred and apologize for the challenges this may have created,” he said.

The firm’s abrupt reversal highlights the continuing potency of gay marriage as a complicated issue that has scrambled traditional political calculations in Washington. President Barack Obama has often called the marriage act “abhorrent,” but his Justice Department defended it for more than a year before declaring it unconstitutional. Attorney General Eric Holder announced in February that the administration would no longer defend the act in court.

Theodore Olson, a solicitor general under President George W. Bush, has joined gay rights groups and Democrats as an advocate for gay marriage. And several high-profile Republicans, including Bush’s wife and his daughter Barbara, have said publicly that they support gay people’s right to marry. But House Republicans have vowed to defend the law in court.

Paul Clement, another solicitor general under Bush and the King & Spalding lawyer hired to lead the case, resigned after his firm’s decision to withdraw.

Clement said the firm had a duty to resist pressure and complete the job for which it was hired.

“I resign out of the firmly held belief that a representation should not be abandoned because the client’s legal position is extremely unpopular,” he wrote.

“Defending unpopular clients is what lawyers do. I recognized from the outset that this statute implicates very sensitive issues that prompt strong views on both sides. But having undertaken the representation, I believe there is no honorable course for me but to complete it.”

Clement wrote that his personal opinions about the marriage act were irrelevant — and he did not indicate what they were. But he said he intended to represent the House in its defense of the law as a partner at Bancroft PLLC, his new employer.

Meanwhile, the sponsors of California’s same-sex marriage ban said Monday that the recent disclosure by the federal judge who struck down Proposition 8 that he is in a long-term relationship with another man has given them new grounds to have his historic ruling overturned.

Lawyers filed a motion in San Francisco’s U.S. District Court, arguing that Chief U.S. District Judge Vaughn Walker should have removed himself from the case or at least disclosed his relationship status because his “impartiality might reasonably be questioned.”

This report includes information from the Associated Press.