The Senate Oct. 11 confirmed Eric Dreiband, a Jones Day attorney who defends companies accused of discrimination, to lead the Justice Department office that enforces anti-bias laws and investigates police civil rights cases.

Lawmakers voted 50-47 to confirm Dreiband to head the DOJ Civil Rights Division. The unit also enforces voting rights laws.

“Those who have worked with Mr. Dreiband emphasize his strong commitment to protecting all Americans’ civil rights,” Majority Leader Sen. Mitch McConnell (R-Ky.) said prior to the vote.

Dreiband represented the University of North Carolina when it implemented policies under the state’s since-repealed “bathroom bill,” requiring people to use gender-designated restroom facilities based on the biological sex listed on their birth certificates. He also won a case for R.J. Reynolds Tobacco that made it harder for workers to sue for age discrimination under federal law.

“Eric Dreiband is the wrong choice to lead the nation’s largest civil rights enforcement agency,” Vanita Gupta, president and CEO of The Leadership Conference on Civil and Human Rights, said in a statement before the vote. “This is particularly important at a time when civil rights are under constant attack by the Trump-Pence administration and its allies. Yet Dreiband has spent most of his career opposing important civil rights legislation and defending corporations who discriminate against their workers.”

Dreiband unsuccessfully represented Abercrombie & Fitch Co. in a case in which a Muslim teenager alleged the clothing company refused to hire her because she wore a religious head scarf. He led a discrimination lawsuit challenging Abercrombie’s employee appearance requirements while at the EEOC but took the opposite position when he went into private practice.