One of President Trump’s federal judicial nominees withdrew from consideration after several Republican senators accused him of anti-religious bias.

Michael Bogren, an attorney in Michigan nominated to serve on the U.S. District Court for the Western District of Michigan, said in a statement Wednesday that he was told there was “no path to confirmation.”

Bogren came under intense scrutiny for a legal defense he provided the city of East Lansing when it was sued by a Catholic-owned farm that refused to allow same-sex marriages on its property. The city found the farm violated its anti-discrimination ordinance and barred it from participating in its farmers market.

In his legal brief, Bogren compared the situation to a Ku Klux Klan-member-owned business refusing service to an interracial couple.

Republican Sens. Josh Hawley (Mo.), Ted Cruz (Tex.) and Thom Tillis (N.C.) led the revolt against Bogren’s nomination, accusing the lawyer of equating the actions of a Catholic family to the KKK.

“I think it’s the right result, and I look forward to getting back to confirming pro-constitution judges . . . religious liberties is an important guarantee of the First Amendment, and that’s what this is about,” Hawley said about Bogren’s withdrawal Wednesday.

When Bogren was pressed on this issue by Hawley during his Judiciary Committee confirmation hearing in May, the nominee said: “I represent clients, not causes. This was not ideological.”

But Bogren was vilified after his hearing, and he withdrew following the backlash.

“I have been accused of being anti-religious, anti-Catholic, and a religious bigot,” Bogren said in his statement. “It was not my intention to compare Catholics to the KKK, and the brief cannot be fairly read as doing so.”

He went on to condemn the personal attacks against him during his hearing and subsequently in the media: “It is truly unfortunate that what used to be a dignified process has sunk to this level.”

Senate Majority Whip John Cornyn (R-Tex.) disagreed with his colleagues’ harsh assessment of Bogren.

“I think it’s just a difference of opinion what a lawyer’s responsibility is to his or her client in court,” Cornyn said. “I don’t think lawyers should be disqualified for positions they’ve taken on behalf of a client in court in a legal argument. That’s just my point of view based on my 13 years on the bench.”

But Cornyn didn’t necessarily disagree with Bogren’s decision to withdraw.

“Well, if he’s not going to get the votes, it’s important to avoid the embarrassment, the unnecessary embarrassment,” Cornyn said.

Sen. Lindsey O. Graham (R-S.C.), the Judiciary Committee’s chairman, said it came down to how well nominees are vetted before they’re picked and said he intends to talk to the White House about what happened.

Seung Min Kim contributed to this report.