A new Massachusetts law prohibiting discrimination against transgender people from restrooms and other public facilities illegally meddles in the "religious practices of a church," argues a federal lawsuit filed Tuesday by four churches in the state. 

Attorneys from a conservative Christian nonprofit filed the lawsuit on behalf of the churches to challenge the constitutionality of the commonwealth’s recent public accommodations laws.

The Massachusetts legislation, officially signed by   Gov. Charlie Baker in July, forbids the discrimination of transgender people from bathrooms, locker rooms and other facilities based on their gender identity. It went into effect on Oct. 1

The lawsuit claims that the law forces churches to violate their religious beliefs and that churches should not count as public spaces in this sense.

Alliance Defending Freedom (ADF), which has helped fight similar transgender bathroom laws in several other states, is representing Horizon Christian Fellowship, Swansea Abundant Life Assembly of God, House of Destiny Ministries and Faith Christian Fellowship of Haverhill.

“The government shouldn’t encroach on the internal, religious practices of a church,” said ADF attorney Steve O’Ban in a news release. “Neither the commission nor the attorney general has the constitutional authority to dictate how any church uses its facility or what public statements a church can make concerning a deeply held religious belief, such as on human sexuality.”

The Massachusetts Commission Against Discrimination was required to develop best practices to help businesses comply with the law. It issued the “gender identity guidance” on Sept. 1 which states that “Even a church could be seen as a place of public accommodation if it holds a secular event, such as a spaghetti supper, that is open to the general public.”

The official legislation expands on that by defining a place of public accommodation as “any place, whether licensed or unlicensed, which is open to and accepts or solicits the patronage of the general public.” Attorney General Maura Healey also noted online that places of public accommodation include “houses of worship.”

The lawsuit counters that all events held at a church have a “religious purpose” and argues that the public accommodations law violates the church’s first amendment religious rights.

With religious exemptions being reviewed on a case-by-case basis by the Massachusetts Commission Against Discrimination, pastors and other church leaders are left without guidelines of what church activities would be subject to violations, according to the lawsuit.

Healey’s office has said that it will review the lawsuit.

“We are pleased that we finally have a law in place that protects transgender people from discrimination in public places,” said Jillian Fennimore, spokesperson for Healey. “This law is about civil rights and is critical for people who were without full protection and equality under the law for too long.”