(CNN) — A Pennsylvania judge on Thursday ordered a suburban Philadelphia county clerk to comply with the state's same-sex marriage ban and stop issuing marriage licenses to gay couples.
Since July, D. Bruce Hanes, the elected Montgomery County register of wills, has given out 174 licenses to same-sex couples, ignoring a 1996 state law that defines marriage as "between one man and one woman."
The state Department of Health sued to stop Hanes, saying he is in "direct defiance" of the ban and "risks causing serious and limitless harm to the public."
In his order Thursday, Judge Dan Pellegrini said Hanes must "cease and desist from issuing marriage licenses to same-sex applicants, from accepting the marriage certificates of same-sex couples, and from waiving the mandatory three-day waiting period." He also denied dozens of requests from same-sex couples in the state to intervene in the lawsuit.
Hanes said in a statement to CNN Thursday that he is "obviously disappointed" in the ruling and will take a few days to discuss options with his county solicitor, including the possibility of appealing the ruling. Until then, he said, he will comply with the order and stop issuing same-sex marriage licenses to gay couples.
The National Organization for Marriage applauded the judge's ruling and said it wants Gov. Tom Corbett to have the marriage licenses declared invalid, it said in a statement.
"This is a victory for marriage. We are pleased that Judge Pellegrini reiterated that Pennsylvania law expressly defines marriage as the union of one man and one woman," said Brian Brown, the group's president.
Hanes told CNN in August that he and his solicitor reviewed the state constitution and decided that language about civil rights, happiness and liberty applied to same-sex couples who want to get married.
"We've either got to change the constitution permit discrimination on the basis of sex, permit civil rights to be frustrated or change the interpretation of that marriage act or change the marriage act. You can't have it both ways," he said in August.
Hanes started issuing the licenses shortly after the U.S. v. Windsor case, in which the U.S. Supreme Court struck down a key part of the federal Defense of Marriage Act, which defined marriage as only between a man and a woman.
Hanes endured plenty of criticism from some state lawmakers who said he had "gone rogue" but also got dozens of notes of thanks from supporters, he said.
Pennsylvania is considered a conservative state on the issue of same-sex marriage, and it is simultaneously fighting a court battle with the American Civil Liberties Union, which sued the state in July after the U.S. Supreme Court ruled on the Windsor case.
The state attorney general, Kathleen Kane, said this year that Pennsylvania's ban on same-sex marriage is "wholly unconstitutional" and that she won't defend the state in the ACLU suit.