The Texas Senate on Tuesday tentatively approved a bill that would allow county clerks to refuse to issue marriage licenses to gay and lesbian couples based on their religious beliefs.

According to the Houston Chronicle, the bill cleared the chamber with a 21-10 vote.

Republican Senator Brian Birdwell authored Senate Bill 522. It would allow clerks to recuse themselves if another clerk or judge can step in and issue the marriage documents.

Birdwell said that the bill was needed to protect the religious liberty of county clerks, judges and others.

“If we don't do this, we are discriminating against people of faith,” Birdwell said. “This bill protects the constitutional issues for both sides.”

While the Supreme Court legalized same-sex marriage nationwide in the 2015 case Obergefell, lawmakers in Texas were unable to address the issue because Texas' Republican-controlled Legislature only meets every two years.

Kathy Miller, president of the Texas Freedom Network, said in a statement that the bill “opens the door to taxpayer-funded discrimination against virtually anyone who doesn't meet a public official's personal moral standards.”