The U.S. Senate on Tuesday confirmed Kyle Duncan, who as a lawyer worked to block LGBT rights, to the Fifth Circuit Court of Appeals.

According to the Washington Blade, the 50-47 vote was along party lines.

The Fifth Circuit has jurisdiction over Texas, Louisiana and Mississippi.

Duncan previously criticized the Supreme Court's 2015 finding in Obergefell that gay and lesbian couples have a constitutional right to marry. Duncan, who filed a brief in the case on behalf of 15 states opposed to extending marriage rights to gay couples, called the ruling an “abject failure” and argued that the decision was invalid because it “raises a question about the legitimacy of the court.” He also defended Virginia and Louisiana's marriage bans in cases challenging the laws.

Duncan also worked on two high-profile cases involving transgender rights. One case involved Gavin Grimm, a teen who challenged his school's refusal to allow him to use the bathroom of his choice. And he defended North Carolina Republican lawmakers in their attempt to keep in place House Bill 2, which prohibited transgender people from using the bathroom of their choice in public buildings.

The Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, called Duncan's record of opposition to LGBT rights “alarming” and criticized the Trump administration for putting forward an “extremist, anti-LGBTQ” judicial nominee.

“In a string of anti-equality nominees from the Trump-Pence administration, Kyle Duncan stands out for his long career fighting to limit the legal protections for LGBTQ Americans,” said David Stacy, HRC Government Affairs Director. "Americans deserve judges we can trust to apply our laws faithfully and administer equal justice under those laws. Kyle Duncan fails that test. It is unconscionable that the Senate has rubber stamped yet another unfit and extreme nominee to a lifetime appointment to the federal bench.”