ATLANTA — The Georgia Senate has passed a bill that would allow adoption agencies receiving taxpayer funding to refuse to work with same-sex couples.

Sponsored by Sen. William Ligon, a Brunswick Republican, the measure was passed Friday by a vote of 35 to 19 after about an hour of contentious debate.

Ligon said the proposal is needed to ensure that faith-based organizations are not kept out of civic life.

“Just because you are a faith-based organization, doesn’t mean you have to check your faith at the door and cannot participate in government programs,” Ligon said.

The core of the bill would give legal protection to faith-based adoption agencies that decline to place a child with people whose lifestyle they do not agree with, including single parents, unwed couples and LGBT couples.

But opponents of the measure say it would effectively allow state-sanctioned discrimination by adoption agencies.

“This proposition that we should … protect agencies that are gonna deny loving families the opportunity to adopt a child from our foster care system is just backward on its face,” said Sen. Nan Orrock, an Atlanta Democrat.

Supporters of the measure say that it is in the best interest of children in the foster care system to allow the broadest number of agencies to operate.

“The public policy of this state should be to maximize the number of at-risk children who are given permanent placement in loving, safe and secure homes,” Sen. Josh McKoon, a Columbus Republican said.

But critics counter that the law could put LGBT youth at risk by placing them with conservative religious families intolerant of their sexual identity.

The bill will next be sent to the House, where it faces an uphill battle to becoming law amid a debate about how legislation seen as discriminatory could impact Georgia’s business community, particularly now with Atlanta among the 20 cities in the running to become Amazon’s second headquarters.

Republican House Speaker David Ralston told WABE Radio that he was interested in “growing economic opportunity for every part of Georgia” and that legislation such as “religious liberties” bills didn’t fit into that plan.

In 2016 Republican Gov. Nathan Deal vetoed a similar but broader “religious liberties” bill after receiving pressure from corporate giants including Coca-Cola. Deal said at the time, “I do not think that we have to discriminate against anyone to protect the faith-based community in Georgia.”

This story has been corrected to show that the Senate passed the measure on Friday, not Thursday.