A federal judge has dismissed a lawsuit challenging Maryland's law that prohibits therapies that attempt to alter the sexual orientation or gender identity of lesbian, gay, bisexual, and transgender minors.

Such therapies go by names such as “conversion therapy,” “reparative therapy,” “sexual orientation change efforts” or “ex-gay therapy.”

According to the AP, the lawsuit was filed in January by Christopher Doyle, the executive director of the Washington, D.C.-based Institute for Healthy Families. Doyle claims that the law violates his right to free speech and religious freedom under the U.S. Constitution.

U.S. District Judge Deborah Chasanow rejected his claims and said that such practices harm children.

“[Professional organizations] indicate that conducting conversion therapy on minors could potentially harm their emotional and physical well-being and, thus, prohibiting the practice of conversion therapy on minors would abate the harmful outcomes caused by conversion therapy,” Chasanow wrote in her ruling.

Doyle is represented by Liberty Counsel, a Christian conservative group vocally opposed to LGBT rights. Liberty Counsel has challenged similar bans in New Jersey and California. One of Doyle's lawyers said that the ruling would be appealed.

The lawsuit names Republican Governor Larry Hogan, who last year signed the measure into law, and state Attorney General Brian Frosh, a Democrat, as defendants.