A magistrate from Madrid who refused to marry same-sex couples after gay marriage was legalized throughout Spain has presented a formal resignation to the country’s Supreme Court.

Antonio Alonso, who is the magistrate for the town of Pinto, said he resigned because he believes that gay marriage is unconstitutional: “It is impossible for me, as a magistrate, to present an appeal for unconstitutionality against the law which allows these marriages.

“I am resigning because it is morally impossible for me to marry homosexual couples, and I can therefore not apply that law.”

There have been three applications for same sex marriages in Pinto since the new law came into effect.

The magistrate refused to marry the first gay couple on October 10. That couple, Marcus Hon and Raúl Robles, finally got married in Canada on November 7.

There have been two other applications for same sex marriage in the town since then. The judge refused to officiate at both of them and neither went ahead.

Attitude toward gay marriage in Spain has been mixed since the law went into effect this summer. The largely Catholic state has been historically liberal with regard to social issues, but members of the church have caused uproar in recent months.