OKLAHOMA CITY — Oklahoma Gov. Mary Fallin signed a bill late Friday that gay rights advocates say would allow religious-based adoption agencies to discriminate against same-sex couples, single people and non-Christians in placing children.

The bill written by Republican Sen. Greg Treat provides legal protections to faith-based agencies that won’t place children in LGBT homes because of religious or moral convictions or policies.

It was supported by the powerful Baptist General Convention of Oklahoma and the state’s Catholic bishops.

An industry group representing major tech companies, including Microsoft, Amazon and Google had opposed the bill.

Treat, currently the Senate majority floor leader who is the president pro tem designate, has said he’s convinced some faith-based groups are hesitant to participate in adoptions for fear of being sued for discrimination.

“I would not be standing here on a bill as controversial as this if I didn’t believe it would help more children to get into loving homes,” Treat said during a sometimes testy debate near the end of the legislative session earlier this month.

Troy Stevenson, executive director of the LGBT-rights organization Freedom Oklahoma, said previously that support of the bill was due to the fact that Treat is in line to become the next Senate leader.

“This is pure politics,” Stevenson said. “It has nothing to do with constituents or districts.”

The new law goes into effect Nov. 1.