The U.S. Senate on Wednesday confirmed President Donald Trump's nomination of Kansas Governor Sam Brownback for ambassador-at-large for international religious freedom.

Vice President Mike Pence cast the tie-breaking vote to confirm Brownback, the AP reported. Pence also used his vote earlier in the day to break a procedural impasse.

“I'm glad to have the vice president in my corner,” Brownback told reporters. “I'm happy. It's a critical job. I'm excited about being able to do it.”

Trump nominated Brownback, who is expected to resign his governorship as early as next week, for the post in July.

LGBT groups had called on the Senate to reject Brownback's nomination.

“For decades, Sam Brownback has attacked the LGBTQ community and worked to undermine fairness and equality,” David Stacy, government affairs director for the Human Rights Campaign (HRC), said in a statement. “His extremist, anti-LGBTQ actions should disqualify him from representing the people of the United States.”

Stacy added that Trump and Pence are “stacking the administration with anti-LGBTQ politicians determined to carry out their harmful and discriminatory policies.”

During his Senate confirmation hearing, Brownback refused to say whether foreign laws criminalizing gay sex were always unjustified.

Democratic Senator Tim Kaine, a former Virginia governor, asked Brownback whether laws criminalizing same-sex relations under the guise of religious freedom are ever justified.

“I don't know what that would be, in what circumstance,” Brownback answered. “But I would continue the policies that had been done in the prior administration in work on these international issues.”

“I really would expect an unequivocal answer on that,” Kaine replied. “But my time is up.”

As governor, Brownback rescinded an executive order issued by previous Governor Kathleen Sebelius, a Democrat, that prohibited the state from employment discrimination on the basis of sexual orientation and gender identity. And he defended in court the state's ban on same-sex marriage.

(Related: Sam Huelskamp, Sam Brownback campaign against gay marriage in Kansas.)