Editor's note: This story was updated to clarify that Sunday's event was a ceremonial bill signing.

THE WOODLANDS — Gov. Greg Abbott has signed into law legislation shielding pastors' sermons from government subpoena power. 

Senate Bill 24 stemmed from the 2014 battle over Houston's anti-discrimination ordinance, when the city subpoenaed sermons of five pastors who opposed it. The legislation was a priority of Lt. Gov. Dan Patrick, who joined Abbott on Sunday for a bill-signing ceremony at the churches of one of those pastors. 

“Texas law now will be your strength and your sword and your shield," Abbott said, invoking Bible verse as he addressed the 11 a.m. service at Grace Church. "You will be shielded by any effort by any other government official in any other part of the state of Texas from having subpoenas to try to pry into what you’re doing here in your churches."

Authored by state Sen. Joan Huffman, R-Houston, SB 24 says a government cannot "compel the production or disclosure of a written copy or audio or video recording of a sermon delivered by a religious leader during religious worship ... or compel the religious leader to testify regarding the sermon." It went into effect immediately when it was formally signed by Abbott on Friday in Austin.

The Texas Tribune thanks its sponsors. Become one.

The law immediately went into effect when Abbott formally signed it Friday in Austin. The event at Grace Church was ceremonial, though it drew a small protest from people concerned Abbott was violating the constitutional separation of church and state. 

Moments before the apex of the ceremony Sunday, Abbott wondered aloud whether it was the first time legislation had been signed at a church in Texas. In 2005, Abbott's predecessor, Rick Perry, held a bill-signing ceremony at a Christian school in Fort Worth — an event that also drew similar protests. 

The fight over the Houston Equal Rights Ordinance turned into a political storm, drawing in state Republican leaders like Abbott and Patrick, as well as GOP officials from outside Texas. Houston voters ultimately struck down the law in 2015.

"Freedom and freedom of religion was challenged here in Houston, and I am proud to say you fight back," Abbott told churchgoers, recognizing Patrick for being involved in the HERO fight "from the very beginning."

Abbott and Patrick made the trip to this Houston suburb against the backdrop of a contentious home stretch to the legislative session in Austin. There appeared to be progress made Saturday toward resolving some of the session's biggest disputes, with the House passing a property tax measure and legislation to keep state agencies operating. Lawmakers also unveiled a budget deal. 

Never miss a moment in Texas politics with our daily newsletter.